Forum Discussion

arpost's avatar
arpost
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

Help! Anyone have a DAX solution for summing values based on dates in a different table?

Greetings, community! Hope someone can help me figure out this DAX scenario. I've tried just about everything of which I can think (SUMX, Calculate, SelectedValue, etc.), and can't figure out a solut...
  • v-chenwuz-msft's avatar
    4 years ago

    Hi arpost ,

     

     

    Measure:

    Measure =
    VAR _s =
        SUMMARIZE (
            'DateSummary',
            [AcountKey],
            [StartDate],
            [EndDate],
            "amount",
                CALCULATE (
                    SUM ( OrderSummary[Amount] ),
                    FILTER (
                        OrderSummary,
                        [AccountKey] = DateSummary[AcountKey]
                            && [TransactionDate] >= [StartDate]
                            && IF ( ISBLANK ( [EndDate] ), TRUE (), [TransactionDate] <= [EndDate] )
                    )
                )
        )
    RETURN
        SUMX (
            _s,
            [amount]
        )
    

     


    Pbix in the end you can refer.

    Best Regards

    Community Support Team _ chenwu zhu

     

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