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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nj-matt
Helper I
Helper I

Return value in matrix visual only for lowest level of hierarchy

I have a dataset that looks like this -->

 

CategoryBrandSKU COGS 
Candy BarsChocolate King6oz $      1.50
Candy BarsChocolate King10oz $      2.00
Candy BarsCrunchie Bar8oz $      1.85
GumChewy GumFruit Flavored $      0.50
GumChewy GumMint Flavored $      0.65

 

When returning the value for Cogs, I only want to display the value for the SKU level.

 

So in the matrix visual, right now it looks like this (using AVERAGE Dax formula) -->

 

nj-matt_0-1617124813615.png

 

Instead I only want this -->

 

nj-matt_1-1617124887544.png

 

Help?

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@nj-matt , you can use isinscope and make the value blank when SKU is not in scope

 

example  measure, where COGS is a measure too

if(not(isinscope(Table[SKU])), blank(), [COGS])

Refer this blog

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@nj-matt , you can use isinscope and make the value blank when SKU is not in scope

 

example  measure, where COGS is a measure too

if(not(isinscope(Table[SKU])), blank(), [COGS])

Refer this blog

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

That did it, thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors