Forum Discussion
arpost
Post Prodigy
4 years agoHelp! 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...
- 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.
v-chenwuz-msft
Community Support
4 years agoHi 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.