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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
mathec01
Frequent Visitor

How to filter a chart by measure

I have a list of data and calculate KPIs values. The KPIs have different way of calculations, so I have a measure that SWITCH to other measures depending on what kind of calculations that KPI need.

 

I have one measure that SWITCH for Month values, and another one for Year-to-date values.

 

I wanna create a filter so I can have 1 chart and can choose if I'm seeing Month values or year-to-date values.

 

Right now I have to drop one of them in Value, so I can see only Month or only year-to-date in a chart.

 

Is it possible to have only one chart and filter which measure I want as value? 

 

Thanks!

 

 

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @mathec01,


Is it possible to have only one chart and filter which measure I want as value? 


Yes, it is.

 

1. Add a new table with a column called "Measure to Show" which contains the measure names you want to show on the chart.

 

t1.PNG

 

2. Create a new measure to switch measures according to the selection on the Slicer of "Measure to Show" column.

Measure = IF ( FIRSTNONBLANK ( Table1[Measure to Show], 1 ) = "m1", [m1], [m2] )

3. Then you should be able to show the new created measure as Values on your chart, and the "Measure to Show" column as Slicer to get your expected result. Smiley Happy

 

Regards

View solution in original post

1 REPLY 1
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @mathec01,


Is it possible to have only one chart and filter which measure I want as value? 


Yes, it is.

 

1. Add a new table with a column called "Measure to Show" which contains the measure names you want to show on the chart.

 

t1.PNG

 

2. Create a new measure to switch measures according to the selection on the Slicer of "Measure to Show" column.

Measure = IF ( FIRSTNONBLANK ( Table1[Measure to Show], 1 ) = "m1", [m1], [m2] )

3. Then you should be able to show the new created measure as Values on your chart, and the "Measure to Show" column as Slicer to get your expected result. Smiley Happy

 

Regards

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors