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
arvindyadav
Post Partisan
Post Partisan

I want Last Months value by LAX function n in power bi

Hi Team,

 

I want previous month value where my current month is January 2019 and the previous month is December 2018.

I am using DAX formula like 

Last month = TOTALMTD([Profit'],DATEADD(DimDate[Date],-1,MONTH))
But won't getting anything from data. Please explain to me why it is happening and if there is a formula to create Last month value, please provide me,
 
 
Thanks,
Arvind
1 ACCEPTED SOLUTION

@arvindyadav

 

Have a look at the attached file.

 

I have created 2 measures. One that gets the values from previous month and the other which gets the cumulative sum.

 

 

View solution in original post

6 REPLIES 6
themistoklis
Community Champion
Community Champion

@arvindyadav

 

Try the following formula:

 

Last month =
CALCULATE ( [Profit'], DATEADD ( DATESMTD ( DimDate[Date] ), -1, MONTH ) )

Hi @themistoklis,

 

Still getting blank value.

 

Thanks,

Arvind

@arvindyadav

 

Can you share the workbook with us?

Hi @themistoklis,

 

Nope, Actually, it is confidential.

But I can share with you some screenshots to understand the data.Last Month.PNGsOME DATA.PNG

@arvindyadav

 

Have a look at the attached file.

 

I have created 2 measures. One that gets the values from previous month and the other which gets the cumulative sum.

 

 

Hi @themistoklis,

 

It works.

Thank You!!

 

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.