Forum Discussion

allwin_1510's avatar
allwin_1510
Frequent Visitor
7 years ago

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

  • v-lili6-msft's avatar
    v-lili6-msft
    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

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

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