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

Handling values, subtotals and totals in measure

Hi,

I have a matrix with where I'm showing values by dimension x on Row axis and Month name / week of year on column axis.
Month name and week of year is set up as a drill down two level hierarchy contatining two different values.

I'm trying to create a measure where I want to fill some cells for dimension x with specific values based on some conditions, and then using these values to set up conditional formatting. For some values, the text color will be the same as the background color, creating the illusion that there are no text filled in the cells - only color fill. However subtotals and total values cannot be formatted using conditional formatting and this is where I need to control those values in my measure.

I've been trying to use ISFILTERED(), HASONEVALUE() and ISINSCOPE() DAX funtions where I successfully created a measure to for example set total value as blank on some rows. However, I'm running in to some issues when trying to apply this on the subtotals of drill down level 2.
From my testing it seems that the subtotals of level 2 (total of month) always is in the same scope as it is when looking on month level at drilldown level 1 (first level). What I would like is to set one value on month (drill down top level) and then another value for the subtotal of month (when expanding drill down on week level).
Is there any way to determine when this value is a subtotal or an actual value? In other words knowing when the matrix is expanded or not.

Br

Max

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

Yes, it is possible. I think you need to add conditions to check current row contents to confirm current level.

 

Reference link:

Clever Hierarchy Handling in DAX

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

Yes, it is possible. I think you need to add conditions to check current row contents to confirm current level.

 

Reference link:

Clever Hierarchy Handling in DAX

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.