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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ScottPat
Frequent Visitor

calculting rolling wages / sales ratio (3mth)

I have a couple of tables linked like below

 

Dates
links to SOHeader (on field [trans_date])
links to SOline [on SO_no)

so line has [sales]

 

Dates
links to GLTransactions (on field [trans_date])
GLTransactions has [wages]

 

I am trying to get a measure for a graph which is

3 mths rolling average wages / 3 mth rolling average sales

which I would just graph against time (the date on the dates table)

 

and where should the measure exist? on the date table?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ScottPat , With help from date table you have to create measure like

 

3 Month Avg = CALCULATE(AverageX(Values('Date'[MONTH Year]),calculate(Sum('Table'[Value])))
,DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-3,MONTH))

 

 

Rolling Months Formula: https://youtu.be/GS5O4G81fww

 

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc
https://medium.com/@amitchandak/power-bi-window-function-3d98a5b0e07f

View solution in original post

2 REPLIES 2
ScottPat
Frequent Visitor

Thanks,

that got me to the solution.

amitchandak
Super User
Super User

@ScottPat , With help from date table you have to create measure like

 

3 Month Avg = CALCULATE(AverageX(Values('Date'[MONTH Year]),calculate(Sum('Table'[Value])))
,DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-3,MONTH))

 

 

Rolling Months Formula: https://youtu.be/GS5O4G81fww

 

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc
https://medium.com/@amitchandak/power-bi-window-function-3d98a5b0e07f

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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