Forum Discussion
Filtering data by a visual is incorrect - Context issue
- Anonymous1 year ago
Hi Alan_GA ,
I think your issue is caused by that the [ID] column will be filtered by date. So it will only show ID in date range.
Here I suggest you to create an unrelated ID table to help calculation.
DimID = VALUES(Sheet1[ID])Measure:
Measure = VAR _IDListbyDate = VALUES ( Sheet1[ID] ) VAR _FinishList = CALCULATETABLE ( VALUES ( Sheet1[ID] ), Sheet1[Status] = "Finished" ) VAR _InprocessList = CALCULATETABLE ( VALUES ( Sheet1[ID] ), REMOVEFILTERS ( Sheet1[Date] ), Sheet1[Status] = "In process" ) RETURN IF ( ISFILTERED ( Sheet1[Status] ), SWITCH ( SELECTEDVALUE ( Sheet1[Status] ), "In process", IF ( MAX ( DimID[ID] ) IN _InprocessList, 1, 0 ), "Finished", IF ( MAX ( DimID[ID] ) IN _FinishList, 1, 0 ) ), IF ( MAX ( DimID[ID] ) IN _IDListbyDate, 1, 0 ) )You can create a table visual by this ID column, then add measure into visual level filter and set it to show items when value =1.
Result is as below.
By Default:
Click on "In process"
Click on "Finished"
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
How about just turning off the interaction between the date slicer and the ID table?
Change how visuals interact in a report - Power BI | Microsoft Learn
Hi, thanks for your reply. If I turn off interaction, I get the correct results for the IDs in "Pending" status. However, when I click on my "Finished" bar, the displayed information is incorrect because it needs to be filtered by date.
The IDs in "Pending" status should be taken entirely regardless of the date, while the "Finished" ones should be within a specific date range