Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Filtering Calculated DAX Table by Max Value in a column

Hey!   I have this problem that I want to filter a calculated table so that it only returns one row per customer where there is the maximum value in another column (Count column). I have tried mult...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous,

    You can try to use the following formula if it suitable for your requirement:

    Commodities per Customer =
    GROUPBY (
        SUMMARIZE (
            MergedSites,
            'SVC by customer'[Business Partner],
            'SVC by customer'[Business Partner ID],
            MergedSites[Primary_Commodity],
            "Csites", COUNTROWS ( MergedSites )
        ),
        [Business Partner],
        [Business Partner ID],
        [Primary_Commodity],
        "MCsites", MAXX ( CURRENTGROUP (), [Csites] )
    )

    If the above expression not helps, can you please share some dummy data that keep the raw data structure with expected results? It is hard to test and modify the expressions without any sample data.

    How to Get Your Question Answered Quickly  

    Regards,

    Xiaoxin Sheng