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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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/

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/

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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