Forum Discussion

josevaras's avatar
josevaras
Icon for Microsoft Employee rankMicrosoft Employee
5 years ago
Solved

Show Filtered Value

Hello everyone,

I use the below statement to return a filtered value. I do it to highlight the value as a header for the visualization. My question is, how do I change the statement below So that if someone choose 2 selections from the filter, both values show up. Example, if I choose "Device 1" then Device 1 shows. But what if I filter for Device 1 and Device 2,
"All Products" will show. TIA

IF(
HASONEVALUE( 'ProductDescriptionsTBL'[Product Specific Name] ),
VALUES( 'ProductDescriptionsTBL'[Product Specific Name] ),
if(
ISFILTERED( 'ProductDescriptionsTBL'[Product Specific Name] ),
"Name",
"All Products"
)
)
  • Hi josevaras ,

     

    Create a measure as below:

     

    Measure = 
    var _count=CALCULATE(DISTINCTCOUNT('Table'[Column1]),ALLSELECTED('Table'[Column1]))
    Return
    IF(NOT(ISFILTERED('Table'[Column1])),BLANK(),
      IF(_count=1,MAX('Table'[Column1]),
      CONCATENATEX(VALUES('Table'[Column1]),'Table'[Column1]," and ")))

     

    And you will see:

     

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!

5 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Icon for Community Champion rankCommunity Champion

    josevaras 

    Just to clarify, do you want to see the filtered individual values listed?

    OR

    If one value is filtered, show that value; if mora than one value is filtered, return "All Values"?

    • josevaras's avatar
      josevaras
      Icon for Microsoft Employee rankMicrosoft Employee

      I would like to see all selected values that have been filtered. 

       

      If i filter for Device 1 and Device 2, I would like to see Device 1 and Device 2. 

       

      I hope that makes sense. Thanks

      • v-kelly-msft's avatar
        v-kelly-msft
        Icon for Community Support rankCommunity Support

        Hi josevaras ,

         

        Create a measure as below:

         

        Measure = 
        var _count=CALCULATE(DISTINCTCOUNT('Table'[Column1]),ALLSELECTED('Table'[Column1]))
        Return
        IF(NOT(ISFILTERED('Table'[Column1])),BLANK(),
          IF(_count=1,MAX('Table'[Column1]),
          CONCATENATEX(VALUES('Table'[Column1]),'Table'[Column1]," and ")))

         

        And you will see:

         

        For the related .pbix file,pls see attached.

         

        Best Regards,
        Kelly

        Did I answer your question? Mark my post as a solution!

  • PaulDBrown's avatar
    PaulDBrown
    Icon for Community Champion rankCommunity Champion

    josevaras  

    Try:

    filtered values =
    IF(ISFILTERED(ProductDescriptionsTBL'[Product Specific Name] ),

    COCATENATEX(VALUES(ProductDescriptionsTBL'[Product Specific Name] ), ProductDescriptionsTBL'[Product Specific Name] , ", "),

    "All Values")