Forum Discussion

TubedData's avatar
TubedData
New Member
2 years ago

Hide data in visual when filter is not used

Hi all. I am currently trying to add a measure to a table visualization that hides data when a filter is not used. I have attempted to use many different functions including ISFILTERED, HASONEVALUE, HASONEFILTER, and ISFILTERED nested in an IF function. I will just add the ISFILTERED measure here.

IsFiltered =
INT(ISFILTERED('Table1'[PersonId]))
The only possible reason for none of my attempted measures working is that the table visual has columns from two tables that have a many to many relationship. I have another visual in my report that only uses columns from one table and the same ISFILTERED measure works fine to hide the data. 
I also noticed that if I change the ISFILTERED filter to show items when value is 2 rather than 1 then the visual hides data when a personID is selected, so the filter is working in some capacity at least?

2 Replies

  • I'm not entirely sure why you have INT() surrounding the ISFILTERED() function, but I don't think it should impact much. The many to many relationship could be the culprit due to underlying functionality and the Blank Row portion that is created. Either way, having a many-to-many relationship isn't going to help you long term.

    As a work around, you may be able to do a check using Variables by comparing the countrows of the table/column when filters are stripped from the column: 

    Check = 
    VAR _CountDropFilter = CALCULATE(
              COUNT('Table'[Column]), REMOVEFILTERS('Table'[Column])
             )
    VAR _CountCurr = COUNT('Table'[Column])
    VAR _Check = _CountDropFilter = _CountCurr
    RETURN
    IF(_Check = TRUE(),"Not Fitlered", "Filtered")

     

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, TubedData 

     

    Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. 

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.