Forum Discussion

RJ_KON's avatar
RJ_KON
Helper I
4 years ago
Solved

DAX measure using isfiltered function

Hi-Power BI geeks,

 

I am trying to bring text display into the card visual and it should display when two slicers and one clustered bar chart visuals are filtered.

So I tried to use the below Dax measure.

 

Comments = IF(ISFILTERED(PainPoint[Ref_SprintTopics]) || ISFILTERED(PainPoint[Initiative Ref]) || ISFILTERED(PainPoint[Raised By]),FIRSTNONBLANK(PainPoint[Comments],0))
 
So my requirement is
when no slicer and other visual is selected the card visual need to show nothing, but it is showing text (Blank).
Need help?
 
Regards
Raj

6 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Community Champion

    Create a measure to use for to format the value conditionally. Something along the lines of:

     

    Format Card Value = 
    IF(
    ISFILTERED(PainPoint[Ref_SprintTopics]) || ISFILTERED(PainPoint[Initiative Ref]) || ISFILTERED(PainPoint[Raised By]), 1, 2)

     

    Here is an example using an equivalent measure and formatting the value conditionally:

    • RJ_KON's avatar
      RJ_KON
      Helper I

      Hi Paul, thanks for looking into the query.

      But, my measure display just 1 and 2, so when I select a visual it should show a text from one of my tables columns. Below is how it should show.

      But when I unselect all visuals it is showing as below, and how I don't want.

      Regards

      Raj

      • PaulDBrown's avatar
        PaulDBrown
        Community Champion

        The card visual must have the measure you need. The Measure for the conditional format you use in the conditional format for the card visual as shown in the screenshots I posted (you will need to adjust the colours of course)

  • Anonymous's avatar
    Anonymous
    Not applicable

    I am in a similar boat, I am using the code. Current Sku/Description =
    IF (
        ISFILTERED ( TRPT_FS_COPA_ADHOC_DTL_V2[SKU/Material Description] ),
        FIRSTNONBLANK (
            TRPT_FS_COPA_ADHOC_DTL_V2[SKU/Material Description],
            TRPT_FS_COPA_ADHOC_DTL_V2[SKU/Material Description]
        ),
        ""
    )

     

    This creates a measure that shows on a card only the selected filter. 

    But what I need help with is having the card show multiple filter selections. Instead of just the first non-blank filter selection. 

     

     

    • PaulDBrown's avatar
      PaulDBrown
      Community Champion

      Is the value displayed that if the selected value in the filter? If so, so can try something along the lines of:

      Filter Values =
      IF (
          ISFILTERED ( TRPT_FS_COPA_ADHOC_DTL_V2[SKU/Material Description] ),
          CONCATENATEX (
              VALUES ( TRPT_FS_COPA_ADHOC_DTL_V2[SKU/Material Description] ),
              TRPT_FS_COPA_ADHOC_DTL_V2[SKU/Material Description],
              ", "
          ),
          ""
      )