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
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
1 REPLY 1
amitchandak
Super User
Super User

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.