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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

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
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.