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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
BalaVenuGopal
Resolver I
Resolver I

How to Select multiple measures from list

Dear All,

 

I have created 4 measures called M1,M2,M3,M4

 

1) I want to display these 4 measures in dropdown list what ever i have choosen that measure needs to be displayed on my chart (Line chart) so in this case measure is dynamic.[ i have created table with display measure and acutual measue as columns and used switch case which is working fine]

 

2) Above logic is working fine with 1 measure at a time.But i want to select multiple measures like i will make slicer properties and allow multiple selectin to true if i have choosen M1,M2 from list grapth should display these two measures.

 

Any help or any idea pease.!!!!!!!!!!

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

Hi @BalaVenuGopal,

 

In that case, there is no need to create an extra measure using SWITCH function to dynamically change measures depend on slicer selection. You should modify the four measures similar to below, and add all of them into visual.

M1 = IF(CONTAINS('Slicer table','Slicer table'[Measures],"M1"),[Measure1],BLANK())

M2 = IF(CONTAINS('Slicer table','Slicer table'[Measures],"M2"),[Measure2],BLANK())

M3 = IF(CONTAINS('Slicer table','Slicer table'[Measures],"M3"),[Measure3],BLANK())

M4 = IF(CONTAINS('Slicer table','Slicer table'[Measures],"M4"),[Measure4],BLANK())

 

1.PNG

 

Reference: Dynamically select measures to be shown on a Power BI visual via slicer

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
theov
Advocate II
Advocate II

Hey there, you can check out this tutorial too 🙂

https://www.youtube.com/watch?v=KYcKmVQNaC8

v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @BalaVenuGopal,

 

In that case, there is no need to create an extra measure using SWITCH function to dynamically change measures depend on slicer selection. You should modify the four measures similar to below, and add all of them into visual.

M1 = IF(CONTAINS('Slicer table','Slicer table'[Measures],"M1"),[Measure1],BLANK())

M2 = IF(CONTAINS('Slicer table','Slicer table'[Measures],"M2"),[Measure2],BLANK())

M3 = IF(CONTAINS('Slicer table','Slicer table'[Measures],"M3"),[Measure3],BLANK())

M4 = IF(CONTAINS('Slicer table','Slicer table'[Measures],"M4"),[Measure4],BLANK())

 

1.PNG

 

Reference: Dynamically select measures to be shown on a Power BI visual via slicer

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This is great, but it does not work for me in a "Matrix" visual, with the 'shy' measures [M1, M2 etc. parallels] as Values. (I did make sure that "Show items with no data" is not set meaning there is no checkmark showing by that option)

 

For testing I made a measure x = BLANK() and put that in the Values section also, and even that showed up as rows (with blank values, of course).

 

Any fix/workaround for this ?

 

Br, Morten

Awesome Thanks alot !!!!!!!!!!!

 

Is there any posibility to hide the unselected measure in legend 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.