Forum Discussion
comparing 1 month
hi
i am looking for dax for comparing past 1 month with current month for my data
Anonymous , You can use time intelligence
example
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
7 Replies
- amitchandakSuper User
Anonymous , You can use time intelligence
example
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA- AnonymousNot applicable
Hi amit
i tried using ur dax on my data but its not displaying any values.
could you plz help me.
- amitchandakSuper User
Anonymous , hope the problem is number type, else use count in place of sum .
Can you share the error, click on details and provide that
- AnonymousNot applicable
hi amit
i tried this dax for calculting last year calls but it is not returing the correct count.
- VijayPCommunity Champion
Anonymous
The Breakup of Formula like this
First to find the Last month revenue = Calculate(Total Revenue, DateAdd(Datedim[date],-1,Month)
you can compar the Data using a Table Visual by placing Date, Total Revenue, Last month Revenue (day by day copmparison)
if you want to see the cumulative then DATESMTD comes into the picture
Current MTD = Calculate(Total Revenue, Datesmtd(dAtedim[date))
Last Month MTD = Calcualte(last month revenue,Datesmtd(datedim[date)
Then you can compared MTD to MTD with an area Chart using Date as Axis to see the comparison - VijayPCommunity Champion
Anonymous
Watch this video to get more clarity if possible
https://www.youtube.com/watch?v=dLON3mj0los&list=PLWQB3PEUJKRn1Y_s8whVWEoPPZa6Wm8B6&index=53
- AnonymousNot applicable
Hi Anonymous ,
You could use PREVIOUSMONTH() function
Measure = CALCULATE ( SUM ( 'Table'[Value] ), PREVIOUSMONTH ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Category] ) )Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.