Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi all!
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:
measure_running_total_last_week =
VAR someDayLastWeek =
TODAY () - 7
VAR modDate =
MOD ( someDayLastWeek, 7 )
VAR lastTuesday = someDayLastWeek - modDate + 3
RETURN
CALCULATE (
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!
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
33 | |
14 | |
13 | |
12 | |
9 |