cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
heidibb Member
Member

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

Accepted Solutions
v-haibl-msft Super Contributor
Super Contributor

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

@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
Highlighted
Habib Established Member
Established Member

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

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

 

 

v-haibl-msft Super Contributor
Super Contributor

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

@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

heidibb Member
Member

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

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?

heidibb Member
Member

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

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!!

heidibb Member
Member

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

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!

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 138 members 1,724 guests
Please welcome our newest community members: