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 August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Slicer as measure - select particular measure based upon slicer selection.

Hi,

 

I am having a requirement, In power bi 

I am having a slicer sales & quantity , so when i select sales only sales measure like (YTD  sales,current sales,previous sales) should be visible. if i select quantity (YTD Quantity,YTD Current Quantity,Previous Quantity) should be visible.

YTD sales,Current sales, Previous sales , YTD quantity,Current Quantity,Previous Quantity are measure used in the report.

 

[Sales , quantity] slicer table is a  disconnected table. 

Anonymous123345_0-1667219487156.png

 

my requirement is like 

If(slicer="Sales",Filter(Ytd Sales,Current Sales,Previous Sales),
filter(YTD Quantity,Current Quantity,Previous Quantity))


Im a bit stuck can anybody help me out?

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @Anonymous 

For your need , you can refer to this solution:Re: Sorting Calculation Group within Headers - Microsoft Power BI Community

1. Create the table Topic with each topic and its associated measure names:

 

vyueyunzhmsft_0-1667268229610.png

 

 

2. Create a fields parameter with each measure listed in the table above. Uncheck "Add slicer to this page".

 

vyueyunzhmsft_1-1667268229761.png

 

 

3. Create a relationship between Topic and TopicParameter. The default is bidirectional, but I changed it to unidirectional (I avoid bidirectional relationships whenever possible).

 

vyueyunzhmsft_2-1667268229628.png

 

 

4. Create a matrix and add TopicParameter to the Values field well:

 

vyueyunzhmsft_3-1667268229627.png

 

 

5. Create a slicer using Topic[Topic].

 

6. Sort by any matrix column:

 

vyueyunzhmsft_4-1667268229622.png

 

Best Regards,

Aniya Zhang

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

2 REPLIES 2
v-yueyunzh-msft
Community Support
Community Support

Hi , @Anonymous 

For your need , you can refer to this solution:Re: Sorting Calculation Group within Headers - Microsoft Power BI Community

1. Create the table Topic with each topic and its associated measure names:

 

vyueyunzhmsft_0-1667268229610.png

 

 

2. Create a fields parameter with each measure listed in the table above. Uncheck "Add slicer to this page".

 

vyueyunzhmsft_1-1667268229761.png

 

 

3. Create a relationship between Topic and TopicParameter. The default is bidirectional, but I changed it to unidirectional (I avoid bidirectional relationships whenever possible).

 

vyueyunzhmsft_2-1667268229628.png

 

 

4. Create a matrix and add TopicParameter to the Values field well:

 

vyueyunzhmsft_3-1667268229627.png

 

 

5. Create a slicer using Topic[Topic].

 

6. Sort by any matrix column:

 

vyueyunzhmsft_4-1667268229622.png

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@Anonymous , Consider field parameters or calculation groups

https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9afd

 

check video link below

 

Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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