Forum Discussion

DavidGolden's avatar
DavidGolden
Icon for Helper I rankHelper I
4 years ago
Solved

values from Order_By column within Summar table

Hi, I used summarize in the (sales) table, and grouped by columns [Cod] and [Sec], being the summary expressión "prima" a simple sum. The virtual summarized table would look like this. Cod S...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi DavidGolden,

    Did you mean the sample table that you shared has been summarized already? If that is the case, you can try to use the following formulas to create a new table if it is suitable for your requirement:

    NewTable =
    VAR summary =
        SUMMARIZE ( 'Table', [Cod], [Sec], "s_prima", SUM ( 'Table'[prima] ) )
    VAR mPrima =
        GROUPBY ( summary, [Cod], "prima", MAXX ( CURRENTGROUP (), [s_prima] ) )
    RETURN
        FILTER ( summary, [s_prima] IN SELECTCOLUMNS ( mPrima, "prima", [prima] ) )

    Regards,

    Xiaoxin Sheng