Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello, i'm looking for a measure to forecast my sales.
I would like to sum the actual sales by month until the current month.
For futher months i would like to have a average of the last 6 months.
Example:
jan feb mrt apr may jun jul aug
100 50 20 10 10 30
july would be (100+50+20+10+20+30)/6 = 38
aug would be (50+20+10+20+30+38)/6 = 28
Solved! Go to Solution.
hi @Oomsen
I think it could not achieve in dax in power bi, this since it will calculate by its own value, it is very difficult to achieve.
Regards,
Lin
@Oomsen , use rolling 6 and divide by 6
example
Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-6,MONTH)) /6
or
Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX(Sales[Sales Date]),-6,MONTH))/6
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...
Appreciate your Kudos.
@amitchandak , thanks for your respons.
My current measure is
hi @Oomsen
Please make sure use Date field from Dimdate in the visual.
If you still have the problem, please share your sample pbix file for us have a test
Regards,
Lin
@v-lili6-msft @amitchandak it works.
For future months it is using 0 for calculating the average instead of the amount in the measure.
Example:
jan feb mrt apr may jun jul aug sep oct nov dec
10 10 20 30 40 50 27 25 23
Expected:
jan feb mrt apr may jun jul aug sep oct nov dec
10 10 20 30 40 50 27 31 33
hi @Oomsen
I think it could not achieve in dax in power bi, this since it will calculate by its own value, it is very difficult to achieve.
Regards,
Lin
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 56 | |
| 47 | |
| 44 | |
| 20 | |
| 20 |
| User | Count |
|---|---|
| 73 | |
| 72 | |
| 34 | |
| 33 | |
| 31 |