Forum Discussion
Anonymous
5 years agoNot applicable
Trailing 365 Daily Total
Hello, I need to add a calculated column to a table that adds the total in the Amount column for ALL rows with a Date within the last 365 days of each row. I have tried numerous different DAX fo...
- 5 years ago
Anonymous
This is your 1st measure:Last 365 = CALCULATE ( SUM ( MyTable[Sales] ), DATESINPERIOD ( MyTable[Date], MAX ( MyTable[Date] ), -365, DAY ) )
The 2nd measure:Diff = [Last 365] - CALCULATE ( SUM ( MyTable[Sales] ), DATESINPERIOD ( MyTable[Date], MAX ( MyTable[Date] ) - 1, -365, DAY ) )
Fowmy
5 years agoSuper User
Anonymous
This is your 1st measure:
Last 365 =
CALCULATE (
SUM ( MyTable[Sales] ),
DATESINPERIOD ( MyTable[Date], MAX ( MyTable[Date] ), -365, DAY )
)
The 2nd measure:
Diff =
[Last 365]
- CALCULATE (
SUM ( MyTable[Sales] ),
DATESINPERIOD ( MyTable[Date], MAX ( MyTable[Date] ) - 1, -365, DAY )
)