Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
allwin_1510
Frequent Visitor

Difference between current month and previous month

 

I am trying to calculate the difference of AHT between the two months for different categories. The AHT displayed is already a measure and i am using a month slicer to filter the data as per months. 

 

CategoryOctober AHTNovember AHT
A2.652.75
B2.352.45
C1.281.64
D1.781.45
E-2.14
F1.911.95
G1.170.72
H2.653.14
I1.431.59

 

what i want to accomplih is this. 

 

 

CategoryOctober AHTNovember AHTDifference
A2.652.75-0.10
B2.352.45-0.10
C1.281.64-0.36
D1.781.450.33
E-2.14-
F1.911.95-0.04
G1.170.720.45
H2.653.14-0.49
I1.431.59-0.16

 

This is an just an example of this month and the month prior. The month slicer has other months too and the difference should change based on the months selected in the slicer. Thank you for you help!!

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi, @allwin_1510

What is your data structure? do you mean that you select two months then calculate the difference between two months?

If so, if you select three or more months, how to calculate the difference?

 

if not, do you mean that calculate difference between two consecutive months?

you could create a date table then use PREVIOUSMONTH  to create a measure bease on [AHT]

like 

difference = CALCULATE([AHT],PREVIOUSMONTH('Date'[Date]))
 

If it is not your case, please share sample pbix file or some data sample and expected output . You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

So do you actually have an October AHT measure and another November AHT measure or is it just one measure?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Just one measure for all months

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.