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 August 31st. Request your voucher.

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/

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

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/

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

That did it, thanks!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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