March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello PowerBI community,
I would like to replicate common financial line graphs to show the past 30 or 60 days using the 15, 30 day rolling averages as trends.
It seems however the visuals can't display moving averages along with relative days filtering.
Examples of these charts can be found in yahoo.finance.
Thank you.
Solved! Go to Solution.
hi, @RogerSteinberg
Based on my test, You could do some optimization on quick measure formula as below:
Qty rolling average = IF( ISFILTERED('Date'[Date]), ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."), VAR __LAST_DATE = LASTDATE('Date'[Date].[Date]) RETURN AVERAGEX( DATESBETWEEN('Date'[Date].[Date], DATEADD(__LAST_DATE, -15, DAY), __LAST_DATE), CALCULATE(SUM('Table3'[Qty])) ) )
Delete the red font section
new Qty rolling average = VAR __LAST_DATE = LASTDATE('Date'[Date]) RETURN AVERAGEX( DATESBETWEEN('Date'[Date].[Date], DATEADD(__LAST_DATE, -15, DAY), __LAST_DATE), CALCULATE(SUM('Table3'[Qty])) )
Now you can use relative days filtering
Best Regards,
Lin
hi, @RogerSteinberg
Based on my test, You could do some optimization on quick measure formula as below:
Qty rolling average = IF( ISFILTERED('Date'[Date]), ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."), VAR __LAST_DATE = LASTDATE('Date'[Date].[Date]) RETURN AVERAGEX( DATESBETWEEN('Date'[Date].[Date], DATEADD(__LAST_DATE, -15, DAY), __LAST_DATE), CALCULATE(SUM('Table3'[Qty])) ) )
Delete the red font section
new Qty rolling average = VAR __LAST_DATE = LASTDATE('Date'[Date]) RETURN AVERAGEX( DATESBETWEEN('Date'[Date].[Date], DATEADD(__LAST_DATE, -15, DAY), __LAST_DATE), CALCULATE(SUM('Table3'[Qty])) )
Now you can use relative days filtering
Best Regards,
Lin
See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |