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
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
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.