Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Calculer la différence entre deux mois

Hello,

 

I am trying to calculate the difference between the current month and the previous month.

To calculate the number of rows in my table I use the following formula:

#Deskphone & Fax = CALCULATE(COUNTROWS(UOP),FILTER(UOP,UOP[Deskphone & Fax]="Deskphone & Fax"))
It gives me a lot of value
But I can't find how to calculate and display the difference between the current month and the previous month.
I am attaching two screenshots for information.

 

 

 
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    Please try:

    Difference = 
    VAR _current_month = [#Deskphone & Fax]
    VAR _previous_month = CALCULATE([#Deskphone & Fax],PREVIOUSMONTH('Calendar'[Date]))
    VAR _result = _current_month-_previous_month
    RETURN
    _result

    and drag the 'calendar[Year],'calendar'[month] and the measure into the table visual.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hello,

    Congratulation it is the best solution

    Thank you for your help

    BR,

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello,

    Congratulation it is the best solution

    Thank you for your help

    BR,

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Please try:

    Difference = 
    VAR _current_month = [#Deskphone & Fax]
    VAR _previous_month = CALCULATE([#Deskphone & Fax],PREVIOUSMONTH('Calendar'[Date]))
    VAR _result = _current_month-_previous_month
    RETURN
    _result

    and drag the 'calendar[Year],'calendar'[month] and the measure into the table visual.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum