Forum Discussion
Calculate Static Quarter Sales
Hi experts!🤗
I am trying to create a table that has average quarter sales from July'2018, until today
So I would have somethiing like that:
| JAS'18 (july, aug & sep) | OND'18 (oct, nov & dec) | JFM'19 | AMJ'19 | |
| sales | xxxx | xxxxx | xxxx | xxxxx |
However, when I apply my formulas, the same data showed for two different quarters, as below:
and these are the formulas I used:
the only thing I changed was the starting month, so it would change the Quarter
I already have a separate month data table.
@yohandipt, try adjusting the date in a DATE function:
JAS'19 = CALCULATE ( SUM ( 'BASE_ÂSELL_OUT (2)'[Sell Out(MSU)] ), DATESINPERIOD ( Amonth[AMonth], DATE ( 2019, 07, 01 ), 2, MONTH ) ) / 3
2 Replies
- DataInsights
Super User
@yohandipt, try adjusting the date in a DATE function:
JAS'19 = CALCULATE ( SUM ( 'BASE_ÂSELL_OUT (2)'[Sell Out(MSU)] ), DATESINPERIOD ( Amonth[AMonth], DATE ( 2019, 07, 01 ), 2, MONTH ) ) / 3 - amitchandak
Super User
Anonymous , you should try Datesqtd if possible with date table.
QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date]))) Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER))) Last complete QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD( ENDOFQUARTER(dateadd('Date'[Date],-1,QUARTER)))) Last to last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-2,QUARTER)))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-YTD-LYTD-Week-Over-Week/m-p/1051626#M184
Appreciate your Kudos.