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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
karnag
Regular Visitor

Aggregate of Max value in a matrix heirarchy

How to get Aggregate of (SUM) of Max Value, which is calculated 

 

Lets say we have A--B in the heirarchy, The following formula is getting correct results calculated at level B, For for Level A, We are getting Max of the values as shown in the snapshot below.  How to get aggregate of the measure formula shown below at level A ?

 

Max of Capacity Hours =
SUMX(
    (VALUES('Enhanced Utilization'[Exp YearMonth])),
    CALCULATE(MAX('Enhanced Utilization'[Capacity Hours]))
)
 
karnag_0-1655155840566.png

 

Appreciate your help

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @karnag ,

I updated your sample pbix file(see attachment), please check if that is what you want. Please update the formula of measure [Max of Capacity Hours average per Exp YearMonth] as below:

Max of Capacity Hours average per Exp YearMonth =
MAXX (
( VALUES ( 'Enhanced Utilization'[Exp YearMonth] ) ),
CALCULATE ( MAX ( 'Enhanced Utilization'[Capacity Hours] ) )
)

yingyinr_0-1655865087397.png

Best Regards

View solution in original post

9 REPLIES 9
karnag
Regular Visitor

Please note the granularity of Capacity Hours is higher Vs the Util Table which is at a much lower level.

karnag
Regular Visitor

Hi @Anonymous 

Here is a snapshot, 

 

Snapshot Util.jpg

Please find the .pbix file at the following location. (Simplified Model)

https://drive.google.com/drive/folders/1uByte3umAH_BW-Ubkm_z-djVlI_ZyV8t?usp=sharing

 

Anonymous
Not applicable

Hi @karnag ,

I updated your sample pbix file(see attachment), please check if that is what you want. Please update the formula of measure [Max of Capacity Hours average per Exp YearMonth] as below:

Max of Capacity Hours average per Exp YearMonth =
MAXX (
( VALUES ( 'Enhanced Utilization'[Exp YearMonth] ) ),
CALCULATE ( MAX ( 'Enhanced Utilization'[Capacity Hours] ) )
)

yingyinr_0-1655865087397.png

Best Regards

Tried the inscope option, But didn't help

karnag
Regular Visitor

Thanks @Anonymous

Will try the solution provided and will get back to you. Appreciate your help

Anonymous
Not applicable

Hi @karnag ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create two measures as below:

 

Sum of capactity hours = SUM('Enhanced Utilization'[Capacity Hours])
Measure = 
IF (
    ISINSCOPE ( 'Enhanced Utilization'[Exp YearMonth] ),
    MAXX ( 'Enhanced Utilization', [Sum of capactity hours] ),
    [Sum of capactity hours]
)

 

yingyinr_0-1655358029799.png

In addition, you can refer the following links.

Hierarchies

Use IsInScope to get the right hierarchy level in DAX

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Hi,

I am looking for something like the one shown below. 

karnag_0-1655901615767.png

 

 

Anonymous
Not applicable

Hi @karnag ,

I updated your sample pbix file(see attachment) again, please check if that is what you want.

1. Update the formula of measure [Max of Capacity Hours average per Exp YearMonth] as below

Max of Capacity Hours average per Exp YearMonth = 
VAR _tab =
    SUMMARIZE (
        'Enhanced Utilization',
        'Enhanced Utilization'[Exp YearMonth],
        "@maxcapacityhour", MAX ( 'Enhanced Utilization'[Capacity Hours] )
    )
RETURN
    SUMX ( _tab, [@maxcapacityhour] )

2. Create another new measure as below to replace the measure [Max of Capacity Hours average per Exp YearMonthon the matrix

Measure = 
SUMX (
    VALUES ( 'Enhanced Utilization'[CONSULTANT_NAME] ),
    [Max of Capacity Hours average per Exp YearMonth]
)

yingyinr_0-1655954574127.png

Best Regards

Thanks @yingyinr

It worked except for the Total row at the bottom.

Appreciate your help. 

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.

Top Solution Authors