Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Sum by Last Operation

Greetings all,   I'm new to Power BI/Dax in general so apologize if this might seems obvious but I couldn't manage to find a way to do it. I have a scenario to Sum the Last Sequence of Each ID as ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    Please try:

    Measure =
    VAR _t =
        ADDCOLUMNS (
            SUMMARIZE ( 'Table', [ID], "Max Sequence", MAX ( 'Table'[Sequence] ) ),
            "Amount",
                LOOKUPVALUE (
                    'Table'[Amount],
                    'Table'[ID], [ID],
                    'Table'[Sequence], [Max Sequence]
                )
        )
    RETURN
        SUMX ( _t, [Amount] )

    Output:

     

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