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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Using DAX to display values up to a certain level of a matrix

Hi everyone, 
I am trying to achieve the result of displaying values in a matrix that has 4 levels of hierarchy only up to a certain point in my matrix

The level of the hierarchy is the following (it's salesforce data for those of you who are familiar with it):

1- Account
2- Opportunity
3- Product Family 
4- Product Name 

The field that I want to show only up to a certain point is the "Stage Name", which is an attribute of the opportunity. Each opportunity is at a certain "Stage Name" (which could be for example proposal, closing, negotiating...stuff like this)

I want this value to be displayed only at the opportunity level of the matrix. The measure I am using is the following:

IF(
ISINSCOPE(Opportunity[Name]) && NOT(ISINSCOPE('Opportunity Product'[Product Family])),
VALUES(Opportunity[StageName])
)

This measure works perfectly in displaying the value of StageName ONLY when I'm browsing at the opportunity level. This is correct. However, the side-effect is that when I browse at the product family level (that is, I go one level deeper in the matrix), the stagename disappears everywhere, also at the opportunity level. This is because now I've reached the "product family" scope and my DAX blanks out the stagename.

Now this is already a good enough result, however I would like to know if there's a way I can keep displaying the "Stage Name" value at the opportunity level also when I'm at the Product Family level. That means: when I go one level deeper than opportunity in the hierarchy and reach Product Family, I would like to keep displaying StageName at the opportunity level but not at the Product Family (the "cell" in the stagename column should be filled only at the opportunity level)

Thanks for any help




1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,

Try if this can help

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

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous ,

Try if this can help

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

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.