Forum Discussion
Aggregate monthly data from daily results
- Anonymous1 year ago
Hi, Peavey
Thanks for the reply form Sahir_Maharaj and DataNinja777. You can try their method, or try the following dax.Target ACC = VAR _CurrentDate = MAX('Table'[Date]) VAR _StartOfMonth = EOMONTH(_CurrentDate, -1) + 1 RETURN CALCULATE( SUM('Table'[Target]), DATESBETWEEN('Table'[Date], _StartOfMonth, _CurrentDate) ) Actual ACC = VAR _CurrentDate = MAX('Table'[Date]) VAR _StartOfMonth = EOMONTH(_CurrentDate, -1) + 1 RETURN CALCULATE( SUM('Table'[Actual]), DATESBETWEEN('Table'[Date], _StartOfMonth, _CurrentDate) )Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi, Peavey
Thanks for the reply form Sahir_Maharaj and DataNinja777. You can try their method, or try the following dax.
Target ACC =
VAR _CurrentDate = MAX('Table'[Date])
VAR _StartOfMonth = EOMONTH(_CurrentDate, -1) + 1
RETURN
CALCULATE(
SUM('Table'[Target]),
DATESBETWEEN('Table'[Date], _StartOfMonth, _CurrentDate)
)
Actual ACC =
VAR _CurrentDate = MAX('Table'[Date])
VAR _StartOfMonth = EOMONTH(_CurrentDate, -1) + 1
RETURN
CALCULATE(
SUM('Table'[Actual]),
DATESBETWEEN('Table'[Date], _StartOfMonth, _CurrentDate)
)
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Thanks to all yes! Sahir_Maharaj & DataNinja777
The solution Anonymous had fit my model the best and it worked perfectly! Many thanks 🙂