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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
WCrayger
Frequent Visitor

Aggregate Distinct Values

Hello,

 

I would like to aggregate distinct values for Extended Invoice Total Amount and Client Subtotal. I'm aware of SUMX(DISTINCT([ColumnName]), MAX(Value)) but that does not work in this scenario. The desired output is 19570 for Extended Invoice Amount and 21527 for Client Subtotal.

 

Thanks in advance.Example.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

try these two measures:

Total Client SubTotal = 
SUMX( 
    SUMMARIZE(
        Table1,Table1[client total])
    ,
    [client total]
)

Total Extended Invoice Amount = 
SUMX( 
    ADDCOLUMNS(
        SUMMARIZE( Table1, Table1[Extended Inv Total]),
        "TEST2",
            CALCULATE(
                MAX(Table1[Extended Inv Total])
            )
    ),
    [TEST2]
)

sumx of distinct with multiple rows.png

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

try these two measures:

Total Client SubTotal = 
SUMX( 
    SUMMARIZE(
        Table1,Table1[client total])
    ,
    [client total]
)

Total Extended Invoice Amount = 
SUMX( 
    ADDCOLUMNS(
        SUMMARIZE( Table1, Table1[Extended Inv Total]),
        "TEST2",
            CALCULATE(
                MAX(Table1[Extended Inv Total])
            )
    ),
    [TEST2]
)

sumx of distinct with multiple rows.png

Thanks for your reply, Nick. Your solution works for Client Subtotal. For Extended Invoice Amount, there is one additional requirement. There can be multiple From Company Key's associated to a Work Order Number. I need to report at the From Company level, and this field will be coming from a seperate dimension table. Example.PNG

Following up. I modified your solution for Extended Invoice Amount by wrapping it in a calculate function with a userelationship arguement. This has solved my issue. 

 

Thanks again for your help, Nick.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.