Forum Discussion

TheV500Oshin's avatar
TheV500Oshin
Regular Visitor
4 years ago
Solved

Filter out rows in a table using a button or toggle

Hello   I need a way of a button/toggle to filter out rows based on a string.   I have created a small table with the fields "Yes" or "No" and I need to filter a table depending on which button i...
  • tamerj1's avatar
    tamerj1
    4 years ago

    TheV500Oshin Here is the sample file with the solution https://www.dropbox.com/t/zcapitgXbnBiz4nX
    The report looks like this 
    This is the measure code

    Measure = 
    VAR Selection =
        IF ( 
            ISFILTERED ('Is CEO'[CEO?] ),
            CALCULATE (
                VALUES ( Employees[Jobtitle] ),
                Employees[Jobtitle] = "CEO"
            ),
            CALCULATE (
                VALUES ( Employees[Jobtitle] ),
                Employees[Jobtitle] <> "CEO"
            )
        )
    VAR Result =
        IF (
            HASONEVALUE ( Employees[EMPID] ),
            Selection
        )
    RETURN
        Result 

    Please let me know if this answers your query or if you need any further modifications.