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.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |