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
DW868990
Helper IV
Helper IV

DAX Measure Based on hierarchy selection in slicers

Hi, 

 

I am looking for the correct DAX so my measure brings out the total based on what the user has selected in slicers.

 

If > 1 Product A is selected then base measure on just Product A,

Else If > 1 Product B by Product B,

Else If > 1 Product C by Product C

Else Product D

 

TIA

1 ACCEPTED SOLUTION
SpartaBI
Community Champion
Community Champion

@DW868990 
The function you need to use for that is ISINSCOPE .
Check out this video (top right on the page) and doc:
https://dax.guide/isinscope/



2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

View solution in original post

2 REPLIES 2
SpartaBI
Community Champion
Community Champion

@DW868990 
The function you need to use for that is ISINSCOPE .
Check out this video (top right on the page) and doc:
https://dax.guide/isinscope/



2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

amitchandak
Super User
Super User

@DW868990 , If slicer table is joined with table or slcier is part of the table then these should get filtered.

 

If those are not joined you can try treatas - https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

 

if you want based selection value

Switch(true() ,

selectedvalue(Table[Product]) =   "Product 1" , [Measure1] ,

selectedvalue(Table[Product]) =   "Product 2" , [Measure2] ,

selectedvalue(Table[Product]) =   "Product 3" , [Measure3] ,

selectedvalue(Table[Product]) =   "Product 4" , [Measure4] )

 

Check if you need field parameters

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

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.