Forum Discussion
POwer bi Table visual gets unfiltered
HI,
I have Sales table and Date table, connected through date column with Many to one relationship, with single side cross filter.
I have added a table visual to the playarea with columns as Date, Customer name and Sales amount. This table is sliced with a slicer coming from Date table.
The slicer is correctly filtering the above data in table visual until I add an newly created measure.
Meaure: Check - If(Isinscope(Salesdata[Customer name]),"Yes",No".
This measure name is "Check" which checks if Customer name column is used in the Table visual and based on the result, it gives "yes' or else 'No". This measure is supposed to add a new column to the table visual with values as Yes or No for every filtered row but when I add this, the table starts showing entire data irresective of any date selected in the Date slicer.
pls help how to fix this so that i can add a new column to table and the data still gets correctly filtered through Date slicer.
I can create a new calculated column for 'Check' instead of measure but it will add unnecessory data to the DB.
Hi harshadrokade ,
This behavior is expected because the ISINSCOPE() function is designed for hierarchical contexts like Matrix visuals, not Table visuals. In a table, the column is always considered “in scope,” so your measure always evaluates to TRUE, which can unintentionally alter the filter context and make it seem like the visual is ignoring the Date slicer.
To achieve your requirement without breaking the filtering, you should avoid using ISINSCOPE() here and instead use a function like HASONEVALUE(Salesdata[Customer name]), which works correctly with slicers and respects the existing filter context. This will allow you to add the Yes/No column while keeping the table properly filtered by the Date slicer, without needing to create a calculated column.
Hope this helps.
Thank you.
4 Replies
- danextian
Super User
That is the expected behaviour of the ISINSCOPE . It returns true when the specified column is the level in a hierarchy of levels in a matrix visual or those that has a hierarchy but a table doesn't have a hierarchy so it is always there.
- Ashish_Mathur
Super User
Hi,
Share the download link of the PBI file.
- harshadrokade
Post Partisan
Sir, Uortunatory I cant uplaod the file due to access issues.
I have Sales data table having Date(Quarter end dates), Customer and Sales amount columns
I am having Date table with dates (Quarter end dates)And I have created a table visual with these columns. I want a measure that will show Yes/No based on check if I used Customer column in the table visual. The given measure unfilters the data in table.
- v-echaithra
Community Support
Hi harshadrokade ,
This behavior is expected because the ISINSCOPE() function is designed for hierarchical contexts like Matrix visuals, not Table visuals. In a table, the column is always considered “in scope,” so your measure always evaluates to TRUE, which can unintentionally alter the filter context and make it seem like the visual is ignoring the Date slicer.
To achieve your requirement without breaking the filtering, you should avoid using ISINSCOPE() here and instead use a function like HASONEVALUE(Salesdata[Customer name]), which works correctly with slicers and respects the existing filter context. This will allow you to add the Yes/No column while keeping the table properly filtered by the Date slicer, without needing to create a calculated column.
Hope this helps.
Thank you.