Forum Discussion

dbrandone's avatar
dbrandone
Helper IV
4 years ago
Solved

Filters Selected as Text with multiple selections

The report consumer has asked that whatever filters are selected in the filter pop out, are displayed in text at the top of the page. I wrote the measure out for this and it works great except when m...
  • dbrandone's avatar
    dbrandone
    4 years ago

    I was able to figure it out. Below is the DAX Measure that worked. I teamed up ISFILTERED and HASONEVALUE in the first step, and then if it doesn't pass that step as TRUE, then it moves on to an AND statement which will allow for the multiple. Thanks for all your help

     

    Filter Text = 
            IF(
                ISFILTERED('Date'[End of Week]),
                CONCATENATE(MIN('Date'[Date]),
                    CONCATENATE(" - ", MAX('Date'[Date]))),
                IF(
                    ISFILTERED('Date'[Month Name]) && HASONEVALUE('Date'[Month Name]),
                    CONCATENATE("Month:   ", SELECTEDVALUE('Date'[Month Year])),
                    IF(
                        AND(ISFILTERED('Date'[Month Name]), ISFILTERED('Date'[Month Name])),
                        CONCATENATE("Month:   ",
                            CONCATENATE(MIN('Date'[Month Year]),
                                CONCATENATE(" - ", MAX('Date'[Month Year])))),
                        IF(
                                ISFILTERED('Date'[Day]),
                                CONCATENATE(MIN('Date'[Date]),
                                    CONCATENATE(": ", MAX('Date'[Date]))),
                                "YEAR-TO-DATE"
                        ))))