I wanted to show last week vs this week for running totals.
I've created a custom 'Date' table that will contain all days.
I think I've got it now.
To get last week's SUM (for Tuesday), I performed the following:
VAR someDayLastWeek =
TODAY () - 7
VAR modDate =
MOD ( someDayLastWeek, 7 )
VAR lastTuesday = someDayLastWeek - modDate + 3
SUM ( data_table[net_quantity] ),
FILTER ( ALL ( 'Date' ), ISONORAFTER ( 'Date'[Date], lastTuesday, DESC ) )
If there is a better way of doing this, please let me know. Thanks all!
Take a look at the September 2023 Power BI update to learn more.
Join Microsoft Reactor and learn from developers.