Forum Discussion

vbis's avatar
vbis
Icon for Helper I rankHelper I
3 years ago

Sum of max values

Hello.

I want to get the sum of max values per country, per customer, per product. 

Here is an example where revenue is the max of values 

countrycustomerproductquarterrevenue
GermanyAbeveragesQ11000
GermanyAfoodQ11000
GermanyAfoodQ21500
GermanyBbeveragesQ11200
GermanyBfoodQ21700
NetherlandsAbeveragesQ21800
NetherlandsBfoodQ22000

 

1 Reply

  • Arul's avatar
    Arul
    Icon for Super User rankSuper User

    vbis ,

    Check whether this is heling or not?

    Max Sum = 
    VAR _tempTable = SUMMARIZE(
        ALLEXCEPT('Table ',
        'Table'[country],
        'Table '[customer],
        'Table '[product]),
        "@Max sum",MAX('Table'[revenue]))
    VAR _result = SUMX(_tempTable,[@Max sum])
    RETURN _result

    Thanks,

    Arul