Forum Discussion
ISFILTERED function against target column doesn't work as expected when there are other filters
- 3 years ago
I was able to reproduce this when using a measure as the visual-level filter. Just having a visual-level filter based on a measure seemed to switch my ISFILTERED(Alerts[Alert Hour]) to true even though there were no direct filters against that column. Even a basic measure like "RETURN 1" with a visual-level filter on that measure and including Alerts[Alert Hour] as a column in the visual made the title switch to filtered.
If you are using the [Alert Hour] column from the fact table, you could resolve this by adding an Alert Hours dimension table with a 1 to many relationship to the Alerts[Alert Hour] column, and using that dimension table for slicing and checking ISFILTERED within the title measure, while keeping the Alerts[Alert Hour] column as the column in the visual.
A possible workaround to your issue is that you could also get the number of total possible alert hours selected and compare the visible values to that instead of using ISFILTERED, if that is feasible in your situation. This would show as being filtered if the visible data didn't include alerts for all hours, so it's not ideal.
Instead of VAR __COND = ISFILTERED('Alerts'[Alert Hour]) this would be:
VAR __DISTINCT_VALUES_COUNT = DISTINCTCOUNT('Alerts'[Alert Hour])VAR __DISTINCT_VALUES_ALLSELECTED = CALCULATE(DISTINCTCOUNT(Alerts[Alert Hour]), ALLSELECTED(Alerts[Alert Hour]))VAR __COND = __DISTINCT_VALUES_COUNT <> __DISTINCT_VALUES_ALLSELECTED
bergen288 , change it like and try
VAR __COND = calculate( ISFILTERED('PBI_XZ_Fraud_Alerts'[Hour]) , allselected())
- bergen2883 years ago
Helper IV
I tried it, but it didn't work.