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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi guys I need your help with a calculation for a rolling year.
Here is the calculation: F% = A(currentmonth going back a year) + B (Full 12 months) - C(full 12 months) + D(full 12 months) - E(For selected month)
This calculation should be dynamic that you can display values for the 12 months.
Currently when I do it it displays the answer at a total level and not the individual months
If you are looking for running total then you could try something like this:
Running Total 2 =
VAR MaxDateInFilterContext = MAX ( Dates[Date] )
VAR MaxYearInFilterContext = YEAR ( MaxDateInFilterContext )
RETURN
CALCULATE (
[Total Sales],
FILTER (
ALL ( Dates ),
Dates[Date] <= MaxDateInFilterContext
&& Dates[Calendar Year Number] = MaxYearInFilterContext
)
)
or
Running Total =
CALCULATE ( [Total Sales], DATESYTD ( Dates[Date] ) )
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!