Forum Discussion

Aravind24's avatar
Aravind24
Frequent Visitor
2 years ago

Need help: DAX Previous Month Comparison

Hi All,

 

I am trying to compare the Month on Month comparison for the year 2024. However my datasource has data from 2023. Dye to whichm Jan'24 is comparing value with Dec'23. I dont need Jan'24 comparison with Dec'23. Kindly help. I use date table.

 

Requesting to kindly help with excluding the comparison for Dec'23. 

Query:

SAAS_OPS_Inflow_MOM =
CALCULATE([SAAS_OPS_Overall_Inflow],
PREVIOUSMONTH('Date'[Date]), REMOVEFILTERS('Date'))
 
Output:
 

 

6 Replies

  • Uzi2019's avatar
    Uzi2019
    Icon for Community Champion rankCommunity Champion

    Hi Aravind24 
    If you want only 2024 years data then use this dax as Measure

    Previous Month =
    CALCULATE(SUM(Lumix[Clicks]),DATEADD('Calendar'[Date],-1,MONTH), YEAR('Calendar'[Date])=YEAR(TODAY()))
     

     

    I hope I answered your question!

     

    • Aravind24's avatar
      Aravind24
      Frequent Visitor

      Hello Thanks for the quick response.

       

      Its not working.

       

      SAAS_OPS_Inflow_MOM =
      CALCULATE([SAAS_OPS_Overall_Inflow],
      DATEADD('Date'[Date], -1, MONTH), YEAR('Date'[Date]) =YEAR(TODAY()))
       
      Its unable to get the value for previous year only

       

  • Uzi2019's avatar
    Uzi2019
    Icon for Community Champion rankCommunity Champion

    Hi Aravind24 

    What should be expected output?
    can you share via excel screenshot for better understanding.