Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
25 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |