Forum Discussion

AmandaCarriveau's avatar
AmandaCarriveau
Frequent Visitor
2 years ago
Solved

Need to apply a nested filter to a table visual

I am connected live to a Power BI semantic model. So I can't create a new column etc. I am trying to write a DAX measure that will allow me to filter a table visual. The model includes a field called RPN which displays a number (1-70) and field called Level which displays one of four names (low, medium, high, TBD). I need to filter my table visual to only show results where RPN is >30 -OR- RPN is less than or equal to 30 and Level is medium or high. Any suggestions?

  • Wilson_'s avatar
    Wilson_
    2 years ago

    Amanda,

     

    Honestly, this would ideally be done upstream anyway. I know you said you couldn't modify the model yourself. However, is it possible to ask whoever has control over the data source itself to add in that filter as a column for you?


    ----------------------------------
    If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

5 Replies

  • Wilson_'s avatar
    Wilson_
    Icon for Memorable Member rankMemorable Member

    Hi Amanda,

     

    You can create a measure like:

     

    Table Visual Filter =
    VAR SelRPN = SELECTEDVALUE ( Table[RPN] )
    VAR SelLevel = SELECTEDVALUE ( Table[Level] )
    VAR Result = SelRPN > 30 || ( SelRPN <= 30 && SelLevel IN { "Medium", "High" } )
    
    RETURN FORMAT ( Result, "" ) -- converts True/False to text

     

     

    Then in your table visual, you can add the measure as a filter and filter for Table Visual Filter is True.


    ----------------------------------
    If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

  • Thanks! But when I tried this, I got the "Visual has exceeded the available resources" error.

    • Wilson_'s avatar
      Wilson_
      Icon for Memorable Member rankMemorable Member

      Amanda,

       

      Honestly, this would ideally be done upstream anyway. I know you said you couldn't modify the model yourself. However, is it possible to ask whoever has control over the data source itself to add in that filter as a column for you?


      ----------------------------------
      If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

      • AmandaCarriveau's avatar
        AmandaCarriveau
        Frequent Visitor

        Yep, I can, was just hoping I could do it myself, thanks for the suggestion!