Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Alexander24
Helper II
Helper II

running total for measure

Hi 

 

I need to make a running total of a measure, I tried using a calculated table however that didnt work either and still gave me the same restult, I am assuming that I need to make some running totals somewhere inside my referenced formaules however not sure

  Any help will be greatly appreciated

Measure is as below

Forecast Forward Volume Trend - Running = 

VAR MONTH1 = DIVIDE([MTD Volume (incl WIP) (Month -1) - PRIORDAY],[MTD Volume (incl WIP) (Month -1) - All],blank())
VAR MONTH2 = DIVIDE([MTD Volume (incl WIP) (Month -2) - PRIORDAY],[MTD Volume (incl WIP) (Month -2) - All],blank())
VAR MONTH3 = DIVIDE([MTD Volume (incl WIP) (Month -3) - PRIORDAY],[MTD Volume (incl WIP) (Month -3) - All],blank())
VAR YEAR1 = DIVIDE([MTD Volume (incl WIP) (YEAR -1) - PRIORDAY],[MTD Volume (incl WIP) (Year -1) - All],blank())
VAR Total = MONTH1+MONTH2+MONTH3+YEAR1
VAR Averagepercentpriorday =AVERAGEX(values(DIM_DATE[Date]),DIVIDE(total,4,blank()))

VAR MONTH1b = DIVIDE([MTD Volume (incl WIP) (Month -1)],[MTD Volume (incl WIP) (Month -1) - All],blank())
VAR MONTH2b = DIVIDE([MTD Volume (incl WIP) (Month -2)],[MTD Volume (incl WIP) (Month -2) - All],blank())
VAR MONTH3b = DIVIDE([MTD Volume (incl WIP) (Month -3)],[MTD Volume (incl WIP) (Month -3) - All],blank())
VAR YEAR1b = DIVIDE([MTD Volume (incl WIP) (Year -1)],[MTD Volume (incl WIP) (Year -1) - All],blank())

VAR Totalb = MONTH1b+MONTH2b+MONTH3b+YEAR1b
VAR Averagepercentday =AVERAGEX(values(DIM_DATE[Date]),DIVIDE(Totalb,4,blank()))

VAR Percentdiff = Averagepercentday-Averagepercentpriorday
VAR Forecastvalue = LOOKUPVALUE(TempTableCurrentMonth[Forecast Value],[LastDate],1)
VAR FORECASTTREND = Percentdiff*Forecastvalue

RETURN 
SUMX(CALCULATETABLE(FILTER(ALLSELECTED(DIM_DATE[Date]),DIM_DATE[Date]<=MAX(DIM_DATE[Date])),all(DIM_DATE[StartOfMonth])),FORECASTTREND)

 

3 REPLIES 3
GilbertQ
Super User
Super User

Hi there, do you just require a running total, or a calculated table containing the running total?

I would like to think that if you create the right measure you can then use this across your entire dataset.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi that is a measure above i was jist saying i also created a table to then try and sum the column in the table and make it running but that didnt work

I need a measure if anyone cam help will be grear

Can you check with Quick measure option?

 

https://powerbi.microsoft.com/en-us/blog/quick-measures-preview

Thanks

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.