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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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