Forum Discussion
Sum to Date
- 5 years ago
NathanSaber , In case you have date prefer Time Intelligence
In This case, the Assume period is joined to Transaction. Ideally, In such cases you need to have the time/period table separately and use that
To Date =
CALCULATE(SUM(Transactions[Amount]),FILTER(ALL(Period),Period[Period] <= MAX(Period[Period])))In case you have a Date, refer
Power BI — YTD
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
Hi NathanSaber,
You can add a values function to your formula to simple group the rolling result based on the current category:
To Date =
CALCULATE (
SUM ( Transactions[Amount] ),
FILTER (
ALLSELECTED ( Transactions[Period] ),
Transactions[Period] <= MAX ( Transactions[Period] )
),
VALUES ( Transactions[Category] )
)
DAX – The Many Faces of VALUES()
BTW, I'd like to suggest you use allselected to replace all function if you want to keep original filter effects apply on your table:
Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT
Regards,
Xiaoxin Sheng