Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
heidibb
Helper IV
Helper IV

Filter a chart based on a measure within a "card"

Hello,

 

Wondering if this is possible.

 

I have a dashboard with 8 "cards" showing 8 different measures for the dimensions selected in the slicers.

My wish is that I can click on one of these "cards" and have a clustered column chart populate with that particular measure.

 

For example:

Cards might include # customers, $ sales and Avg $ per Customer across the top of my page.

If I click on # customer card, the bar chart would show the # of customers by sales person

If I then click on the $ sales card, the same bar chart would then show the $ sales by sales person

If I then click on the Avg $ per Customer card, the same bar chart would then show that measure by sales person.

 

Possible?

 

Thanks so much.

1 ACCEPTED SOLUTION
v-haibl-msft
Employee
Employee

@heidibb

 

I agree with @Habib, we can use Chiclet Slicer to simulate the “Cards”. A new table which includes the measure names needs to be created.

Filter a chart based on a measure within a card_1.jpg

 

Then create a measure with following formula.

MeasureSelected = 
IF (
    HASONEVALUE ( Table2[Measures] ),
    SWITCH (
        FIRSTNONBLANK ( Table2[Measures], Table2[Measures] ),
        "# customers", [# customers],
        "$ sales", [$ sales],
        "Avg $ per Customer", [Avg $ per Customer]
    ),
    BLANK ()
)

Drag Table2[Measures] column into Category of Chiclet Slicer and MeasureSelected into Value of Clustered column chart.

Filter a chart based on a measure within a card_2.jpg

 

Best Regards,

Herbert

View solution in original post

5 REPLIES 5
v-haibl-msft
Employee
Employee

@heidibb

 

I agree with @Habib, we can use Chiclet Slicer to simulate the “Cards”. A new table which includes the measure names needs to be created.

Filter a chart based on a measure within a card_1.jpg

 

Then create a measure with following formula.

MeasureSelected = 
IF (
    HASONEVALUE ( Table2[Measures] ),
    SWITCH (
        FIRSTNONBLANK ( Table2[Measures], Table2[Measures] ),
        "# customers", [# customers],
        "$ sales", [$ sales],
        "Avg $ per Customer", [Avg $ per Customer]
    ),
    BLANK ()
)

Drag Table2[Measures] column into Category of Chiclet Slicer and MeasureSelected into Value of Clustered column chart.

Filter a chart based on a measure within a card_2.jpg

 

Best Regards,

Herbert

Thanks both! Not my ideal solution as it adds another component to the view that I was hoping to eliminate, but it might work. One question. I just downloaded the newest version of Power BI and I don't have the chiclet slicer option. Is that a seperate add-in that needs to be downloaded seperatly?

I was able to get the chiclet slicer just fine! Now I'm following your example and I've created a new datasource with hand typed terms for my measures. I'm just not sure how to link this up to my actual data. I'm not clearly understanding what the calculation is doing.

Thanks in advance!!

Sorry for the many follow-up posts, but I was able to get this to work for me! I didn't pay close attention to your attached picture, so now I understand that the new meausure needed to be created in the main data set! Works fine! Thanks so much for your help!

Habib
Responsive Resident
Responsive Resident

Hi @heidibb

 

Card visual can't be used as selector and you will not be able to filter your other visuals based on its selection.

 

You need to look for some other workarround where you can apply a filter which will be displayed as tiles on dashboard top and you need to create your measures based on some DAX by applying SWITCH statement. Below artical can help you regarding this although its about Power Pivot.

 

http://sqljason.com/2012/11/measure-selection-using-slicers-in.html

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.