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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
tanj1
Frequent Visitor

Need some help to create a measure to total max value of daily sum

I'm new to Power BI. I need some help to create a measure to sum up the max "ORADailyPreTotal" of each client in the table below. I would like to sum up only the maximium of each client daily sum which is 6877.909871 + 6675.3583845. Thanks a lot in advance.

tanj1_2-1647710047515.png

 

 

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @tanj1 ,

 

Try the following measure. The idea is to create a virtual table, filter out the maximum values from the virtual table, and then add them together.

 

Result =
VAR _table =
    ADDCOLUMNS (
        'Table',
        "max",
            CALCULATE (
                MAX ( 'Table'[ORADailyPreTotal] ),
                FILTER ( ALLSELECTED ( 'Table' ), [client] = EARLIER ( 'Table'[client] ) )
            )
    )
RETURN
    SUMX ( FILTER ( _table, [max] = [ORADailyPreTotal] ), [ORADailyPreTotal] )

 

vstephenmsft_0-1647915385002.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

tanj1
Frequent Visitor

Hi Stephen & Pete, apprecaite all your help.

Somehow I'm not able to get it work for the last few days. 

I tried using the above formular but somehow still can't get it work.

I would like to get the result of 14802.74685 from this CSV file.  

 

Here is the CSV File Picture.JPG

View solution in original post

8 REPLIES 8
tanj1
Frequent Visitor

Thanks a lot Stephen Tao 😉

tanj1
Frequent Visitor

Thanks a lot Stephen Tao!😉

tanj1
Frequent Visitor

Hi Stephen & Pete, apprecaite all your help.

Somehow I'm not able to get it work for the last few days. 

I tried using the above formular but somehow still can't get it work.

I would like to get the result of 14802.74685 from this CSV file.  

 

Here is the CSV File Picture.JPG

Anonymous
Not applicable

Hi @tanj1 ,

 

Create a daily measure.

Daily =
CALCULATE (
    SUM ( data[Pre GB] ),
    FILTER (
        ALLSELECTED ( data ),
        [Year] = MAX ( 'data'[Year] )
            && [client] = MAX ( 'data'[client] )
            && [Day] = MAX ( 'data'[Day] )
            && [Month] = MAX ( 'data'[Month] )
    )
)

Then create another measure to filter the max value.

Max =
IF (
    MAXX (
        FILTER (
            ALLSELECTED ( data ),
            [Year] = MAX ( 'data'[Year] )
                && [Month] = MAX ( 'data'[Month] )
                && [client] = MAX ( 'data'[client] )
        ),
        [Daily]
    ) = [Daily],
    [Daily],
    BLANK ()
)

vstephenmsft_0-1648015854714.png

There is also a max value in March, but your expected result is 14802.75. Do you want to calculate the sum of the maximum values only in February?

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Stephen. Almost getting there 😀.

I would like to get the max of any date for BBB and AAA and sum them together. 

Anonymous
Not applicable

Hi @tanj1 ,

 

OK. To add them up. Try

Total=SUMX('DATA', [Max])

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @tanj1 ,

 

Try the following measure. The idea is to create a virtual table, filter out the maximum values from the virtual table, and then add them together.

 

Result =
VAR _table =
    ADDCOLUMNS (
        'Table',
        "max",
            CALCULATE (
                MAX ( 'Table'[ORADailyPreTotal] ),
                FILTER ( ALLSELECTED ( 'Table' ), [client] = EARLIER ( 'Table'[client] ) )
            )
    )
RETURN
    SUMX ( FILTER ( _table, [max] = [ORADailyPreTotal] ), [ORADailyPreTotal] )

 

vstephenmsft_0-1647915385002.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Stephen, I'm going to open again this thread since it is not appliable to my case.

I've a Back End product from which Two final Products came (for instance 1 same frame to have 2 distinct clock). Now, I've the Stock of this Back End product (for instance 1000) and relevant orders that covers only 200 pcs. I've to count the delta (+800) and valorize them to a final report. In excel it is working (the attached table is an extraction of a table from which a pivot table was created showing me the correct value of these 800pieces not covered by orders). In power bi, applying the measure you're telling above, the results is by four times instead of only once. Is it possible to have the max of all these back end products and then the sum of these maxes?

 

FIN_PRODBEG_PRODDataSTK_BEG_PRODBKLG_BEG_PRODUNCO_BEG_PRODUNCO_VAL_BEG_PROD
PROD1PRODBEQ20240314298851000919880
PROD1PRODBEQ20240414298819000729880
PROD1PRODBEQ20250114298829000439880
PROD1PRODBEQ2025021429882500414880
PROD1PRODBEQ2025031429882500389880
PROD1PRODBEQ2025041429880389881271.572848
PROD1PRODBEQ20240314298851000919880
PROD1PRODBEQ20240414298819000729880
PROD1PRODBEQ20250114298829000439880
PROD1PRODBEQ2025021429882500414880
PROD1PRODBEQ2025031429882500389880
PROD1PRODBEQ2025041429880389881271.572848
PROD1PRODBEDEL.CY14298801429880
PROD1PRODBEQ20240314298851000919880
PROD1PRODBEQ20240414298819000729880
PROD1PRODBEQ20250114298829000439880
PROD1PRODBEQ2025021429882500414880
PROD1PRODBEQ2025031429882500389880
PROD1PRODBEQ2025041429880389881271.572848
PROD2PRODBEQ20240314298851000919880
PROD2PRODBEQ20240414298819000729880
PROD2PRODBEQ20250114298829000439880
PROD2PRODBEQ2025021429882500414880
PROD2PRODBEQ2025031429882500389880
PROD2PRODBEQ2025041429880389881271.572848
PROD2PRODBEQ20240314298851000919880
PROD2PRODBEQ20240414298819000729880
PROD2PRODBEQ20250114298829000439880
PROD2PRODBEQ2025021429882500414880
PROD2PRODBEQ2025031429882500389880
PROD2PRODBEQ2025041429880389881271.572848

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