Forum Discussion
Running Total with three years
- 1 year ago
Hi Anonymous,
Apologize for the delayed response. After thoroughly reviewing the details you provided, I reproduced the scenario again, and it worked on my end. I used it as sample data and successfully implemented it.
outcome:
I am also including .pbix file for your better understanding, please have a look into it:
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
Hi Anonymous,
Thank you for reaching out to the Microsoft fabric community forum. Thank you Ray_Minds, and rajendraongole1, for your inputs on this issue. After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.
Please try this measures I have tried with some sample data in my end, it worked fine:
Selected Quarter Cumulative Booking Amount:
CumulativeBookingAmount =
VAR SelectedQuarter = SELECTEDVALUE(SalesTable[Fiscal Quarter])
VAR MaxWeek = MAXX(FILTER(SalesTable, SalesTable[Fiscal Quarter] = SelectedQuarter), SalesTable[FiscalWeekNumber])
RETURN
CALCULATE(
SUM(SalesTable[Booking Amount]),
SalesTable[Fiscal Quarter] = SelectedQuarter,
SalesTable[FiscalWeekNumber] <= MaxWeek
)
Previous Year Same Quarter Cumulative Booking Amount:
PY_CumulativeBookingAmount =
VAR SelectedQuarter = SELECTEDVALUE(SalesTable[Fiscal Quarter])
VAR CurrentYear = LEFT(SelectedQuarter, 4) * 1
VAR CurrentQtr = RIGHT(SelectedQuarter, 2)
VAR PrevQuarter = FORMAT(CurrentYear - 1, "0000") & CurrentQtr
RETURN
CALCULATE(
SUM(SalesTable[Booking Amount]),
SalesTable[Fiscal Quarter] = PrevQuarter
)
Previous to Previous Year Same Quarter Cumulative Booking Amount:
PPY_CumulativeBookingAmount =
VAR SelectedQuarter = SELECTEDVALUE(SalesTable[Fiscal Quarter])
VAR CurrentYear = LEFT(SelectedQuarter, 4) * 1
VAR CurrentQtr = RIGHT(SelectedQuarter, 2)
VAR PrevPrevQuarter = FORMAT(CurrentYear - 2, "0000") & CurrentQtr
RETURN
CALCULATE(
SUM(SalesTable[Booking Amount]),
SalesTable[Fiscal Quarter] = PrevPrevQuarter
)
I am also including .pbix file for your better understanding, please have a look into it:
I hope this could resolve your issue, if you need any further assistance, feel free to reach out. If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
approach is good but when i selected 2025Q4 it is only showing current year data, it should show three lines in a single chart with 4 weeks data for 2025q4 and all 13 weeks dta for 2024q4,2023q4
- v-kpoloju-msft1 year agoCommunity Support
Hi Anonymous,
Apologize for the delayed response. After thoroughly reviewing the details you provided, I reproduced the scenario again, and it worked on my end. I used it as sample data and successfully implemented it.
outcome:
I am also including .pbix file for your better understanding, please have a look into it:
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.- v-kpoloju-msft1 year agoCommunity Support
Hi Anonymous,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.