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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
raviteja1994
Regular Visitor

DAX Create measure with multiple aggregations over 2 columns

Hello,

 

I am trying to create a DAX measure with following table.

 

Column AColumn BColumn CDateValue
11P110/26/201710
11P110/27/201720
13P310/28/201710
22P110/29/201715
22P210/30/201725


I want to dislpay the following grid data. 

Column AColumn B Value
1120
1310
2240

 

The measure is calculated as follows:  It is a 2 step aggregation

Get the max value for each of the first 3 column values. i.e after the 1st aggregation the result would look like:

Column AColumn B Column CValue
11P120
13P310
22P115
22P225

 

Now sum it over first 2 columns to get the final result which is:

 

Column AColumn B Value
1120
1310
2240

 

Help me in creating the DAX measure which would result in the above data when I create a table visual in Power BI.  Thanks in advance..

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft Employee
Microsoft Employee

@raviteja1994

You can try

sum =
VAR first_agg_tbl =
    SUMMARIZE (
        yourTable,
        yourTable[Column C],
        "Max of each column C", MAX ( yourTable[Value] )
    )
RETURN
    SUMX ( first_agg_tbl, [Max of each column C] )

Capture.PNG

View solution in original post

2 REPLIES 2
Eric_Zhang
Microsoft Employee
Microsoft Employee

@raviteja1994

You can try

sum =
VAR first_agg_tbl =
    SUMMARIZE (
        yourTable,
        yourTable[Column C],
        "Max of each column C", MAX ( yourTable[Value] )
    )
RETURN
    SUMX ( first_agg_tbl, [Max of each column C] )

Capture.PNG

Thank you Eric. It was working great..

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.