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.
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 Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It works for me! Thank you very much