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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors