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
antoinersw
Regular Visitor

Sum of max with filters on max col

Hello, these are the data I work with :

 

antoinersw_1-1674498346424.png

 

In the third column, _heures projete signes, I have the sum of the max values

The new col (is a the target measure i designed on paint) sub totals should be the multiplication of

  • the max _heures projete signes by the Duree presta value on the same row. Hence 104*10  = 1040

the grand total should be the sum of the max value for client A and B

 

Please advise the right DAX for that result 🙂

regards

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @antoinersw,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

In addition, you can also try to use the following measure formula if it helps:

formula =
VAR summary =
    ADDCOLUMNS (
        SUMMARIZE (
            'Table',
            'Table'[Client],
            "maxSignes",
                CALCULATE (
                    MAX ( 'Table'[heures projete signes] ),
                    ALLSELECTED ( 'Table' ),
                    VALUES ( 'Table'[Client] )
                )
        ),
        "maxPresta",
            CALCULATE (
                MAX ( 'Table'[Duree presta] ),
                FILTER (
                    ALLSELECTED ( 'Table' ),
                    'Table'[heures projete signes] = [maxSignes]
                        && 'Table'[Client] = [Client]
                )
            )
    )
RETURN
    SUMX ( summary, [maxSignes] * [maxPresta] )

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @antoinersw,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

In addition, you can also try to use the following measure formula if it helps:

formula =
VAR summary =
    ADDCOLUMNS (
        SUMMARIZE (
            'Table',
            'Table'[Client],
            "maxSignes",
                CALCULATE (
                    MAX ( 'Table'[heures projete signes] ),
                    ALLSELECTED ( 'Table' ),
                    VALUES ( 'Table'[Client] )
                )
        ),
        "maxPresta",
            CALCULATE (
                MAX ( 'Table'[Duree presta] ),
                FILTER (
                    ALLSELECTED ( 'Table' ),
                    'Table'[heures projete signes] = [maxSignes]
                        && 'Table'[Client] = [Client]
                )
            )
    )
RETURN
    SUMX ( summary, [maxSignes] * [maxPresta] )

Regards,

Xiaoxin Sheng

antoinersw
Regular Visitor

Hello, is the calculus not clear enough ?

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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