Forum Discussion

MikhailGG's avatar
MikhailGG
Helper I
3 years ago
Solved

Applying multiple choice filter to Clustered Column Chart

Hello, I have the following custom filter, for which I created a separate table using

To get:

Which was created using few measures. In one measure I used Maxx function to get the difference between 2 variables:

 

in another measure I created the following choices: 

Then I created this measure: 

 

Everything works fine when I have a single choice in filter: 

 

But as soon as I make multiple choices it all reverts to select all, and doesn't show correct results. I know that SelectedValue() function takes only one value, but is there a way to do something so that when I choose for example 2 options: Paid Amount Exceeds Contracted Amount and Paid Amount Less Than Contracted Amount, it will show only those on the Chart?

 

  • MikhailGG change your measure filter to this:

     

    Filter Status = 
    VAR __vendor = SUMMARIZE ( Vendor, "@Status", [Status] )
    VAR __filter = FILTER ( __vendor, [@Status] IN VALUES ( 'Vendor Status'[Status] ) )
    RETURN
    COUNTROWS ( __filter )

     

    Change the table and column name as per your model.

     

    👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo

3 Replies

    • MikhailGG's avatar
      MikhailGG
      Helper I

      I can't provide the actual data, but let's say it looks something like this (or any randomly generated values for these 3 vars):

      I would like to create a clustered column chart of Contracted Amound and Paid Amoint for each of the vendors. Then I'd like to create a custom filter, which will allow me to filter for 3 different cases:

      • Paid Amount Equals Contracted Amount
      • Paid Amount Exceeds Contracted Amount
      • Paid Amount Less than Contracted Amount

      I was able to create this custom filter using the approach described in my orifinal post, and it works fine while I select a single status( e.g Paid Amount Less than Contracted Amount). However, when I try to select multiple statuses (e.g. Paid Amount Less than Contracted Amount and Paid Amount Exceeds Contracted Amount) to be shown on the same chart, then my filter stops working and doesn't show the correct results.

  • MikhailGG change your measure filter to this:

     

    Filter Status = 
    VAR __vendor = SUMMARIZE ( Vendor, "@Status", [Status] )
    VAR __filter = FILTER ( __vendor, [@Status] IN VALUES ( 'Vendor Status'[Status] ) )
    RETURN
    COUNTROWS ( __filter )

     

    Change the table and column name as per your model.

     

    👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo