Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi All,
I have data like this. I want to calculate past 7 days rolling average and the folrmula should be
[sum(Pass wafers in past 7D)] / [sum(Pass + Fail wafers in past 7D)]
I have 3 filters in my power bi as Year , Month and Day. Please help me with Dax
My approach was :
1.Calculated pass pass percentage
Thanks In advance
Solved! Go to Solution.
Hi All,
This Dax used for me to calculated 7D_Rolling average:
7D_Rolling average=
Var Sum_waferpasses_7 = calculate(sum(YIELD[WAFERPASS]),DATESBETWEEN('YIELD'[QC_DATE_OUT].[Date],DATEADD(LAST_DATE, -6, DAY),LAST_DATE))
Var Sum_allthewafers_7 = calculate(sum(YIELD[TotalWafers]),DATESBETWEEN('YIELD'[QC_DATE_OUT].[Date],DATEADD(LAST_DATE, -6, DAY),LAST_DATE))
return divide(Sum_waferpasses_7 ,Sum_allthewafers_7))
Thanks
Hi @YasminYas
I would suggest you create a rolling sum first.Then divide it with 7.Please refer to this article.
https://www.sqlbi.com/articles/rolling-12-months-average-in-dax/
If you need further help, please share a simplified data sample and expected output.You can upload the .pbix to OneDrive and post the link here. Do mask sensitive data before uploading.
Regards,
Cherie
There is a Rolling Average quick measure I believe. Also, 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...
Hi All,
This Dax used for me to calculated 7D_Rolling average:
7D_Rolling average=
Var Sum_waferpasses_7 = calculate(sum(YIELD[WAFERPASS]),DATESBETWEEN('YIELD'[QC_DATE_OUT].[Date],DATEADD(LAST_DATE, -6, DAY),LAST_DATE))
Var Sum_allthewafers_7 = calculate(sum(YIELD[TotalWafers]),DATESBETWEEN('YIELD'[QC_DATE_OUT].[Date],DATEADD(LAST_DATE, -6, DAY),LAST_DATE))
return divide(Sum_waferpasses_7 ,Sum_allthewafers_7))
Thanks
| User | Count |
|---|---|
| 52 | |
| 41 | |
| 32 | |
| 15 | |
| 13 |
| User | Count |
|---|---|
| 84 | |
| 72 | |
| 37 | |
| 27 | |
| 24 |