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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.