Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi, I am building a report to show last 3 months of data grouped by Month to Date and Year to date. I created a measure to Calculate the year to date amount and used the datesinperiod function to get the last 3 months. However the Ytd is not showing correctly. For instance when I select a month to show the last 3 months from, Its not calculating the YTD from January but from the earliest of the last 3 months from the month selected.
Solved! Go to Solution.
Try Use following to calculate YTD and see if this works for you
Amount_YTD =
CALCULATE(SUM(IncomeStatement[Value]),DATESYTD(IncomeStatement[EndofMonth]),ALL(IncomeStatement))
Proud to be a Super User!
Can you please share the DAX code that you are writing to calculate your YTD ?
Also if possible if you can share the columns/measures that you are using while creating the Matrix/Visual
Proud to be a Super User!
Amount_YTD= TOTALYTD(SUM(IncomeStatement[Value]),IncomeStatement[EndofMonth],"Dec/31")
Try Use following to calculate YTD and see if this works for you
Amount_YTD =
CALCULATE(SUM(IncomeStatement[Value]),DATESYTD(IncomeStatement[EndofMonth]),ALL(IncomeStatement))
Proud to be a Super User!
It's an improvement but it returns duplicates of the first row. The All function is causing it.
I figured out what the problem was. The all was applied to the wrong table. Thanks @FarhanAhmed
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |