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
Aravind24
Regular Visitor

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:
 
Aravind24_0-1714041343800.png

 

6 REPLIES 6
Uzi2019
Super User
Super User

Hi @Aravind24 

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

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Hi @Aravind24 

I dont understand why you are getting 20 in all values as i dont know the your modeling. As you can see in my screnshot i am getting correct result what you are expecting. 

 

I just connect my date filed with Calendar date table. and I also created month year column which is date data type

 

Please check your modeling.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
Uzi2019
Super User
Super User

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()))
 

Uzi2019_0-1714042916243.png

 

I hope I answered your question!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

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
Aravind24_0-1714044346951.png

 

Aravind24
Regular Visitor

@Ritaf1983  @DU  @mussaenda  -- please help experts 

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.