Forum Discussion
Error on Running Total with a Date Table
- 5 months ago
Hi mschneider54 ,
Based on the above problem statement I have recreated the scenario,
In your dax you are resetting the month value thats causing the issue
I hope this is what you are looking for .
Visual :Gift Data :
Date :
Mark it as date table, Month name sort by month id .
Data model:Dax:
1) using the YTD function:Running Total YTD = CALCULATE(SUM('Gift Data'[AmountReceived]), DATESYTD('Date Table'[Date]))
2) using the max date funtion :Running Total YTD by max function = CALCULATE( SUM('Gift Data'[AmountReceived]), FILTER( ALL('Date Table'), 'Date Table'[Date] <= MAX('Date Table'[Date]) && YEAR('Date Table'[Date]) = YEAR(MAX('Date Table'[Date])) ) )
Pbix file :
Running Sum.pbix
Thanks
If you found this helpful, please consider giving it a kudo and marking it as the accepted solution — it goes a long way in helping others facing the same issue.
For more Power BI tips and discussions, let’s connect on LinkedIn:
https://www.linkedin.com/in/natarajan-manivasagan
Cheers!
Hi mschneider54 ,
Based on the above problem statement I have recreated the scenario,
In your dax you are resetting the month value thats causing the issue
I hope this is what you are looking for .
Visual :
Gift Data :
Date :
Mark it as date table, Month name sort by month id .
Data model:
Dax:
1) using the YTD function:
Running Total YTD = CALCULATE(SUM('Gift Data'[AmountReceived]), DATESYTD('Date Table'[Date]))
2) using the max date funtion :
Running Total YTD by max function =
CALCULATE(
SUM('Gift Data'[AmountReceived]),
FILTER(
ALL('Date Table'),
'Date Table'[Date] <= MAX('Date Table'[Date])
&& YEAR('Date Table'[Date]) = YEAR(MAX('Date Table'[Date]))
)
)
Pbix file :
Running Sum.pbix
Thanks
If you found this helpful, please consider giving it a kudo and marking it as the accepted solution — it goes a long way in helping others facing the same issue.
For more Power BI tips and discussions, let’s connect on LinkedIn:
https://www.linkedin.com/in/natarajan-manivasagan
Cheers!