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
Anonymous
Not applicable

Previous Month

Looking for a way to calculate the previous month's value like below

 

The Previous Month Volume Column is what I am looking to do with DAX. So for Jan I want to See December, for Feb I want to see Jan. etc.

 

Csmith31_1-1634582906819.png

 

 

1 ACCEPTED SOLUTION
aj1973
Community Champion
Community Champion

Hi @Anonymous 

Please add a column Order(for Month order) to your table and use

aj1973_0-1634656924562.png

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

4 REPLIES 4
aj1973
Community Champion
Community Champion

Hi @Anonymous 

There are different ways to do it but I am going to refer to your sheet:

 
Load Previous Month  =
var _PreviousMonth= CALCULATE(MAX(Table[Month]), FILTER(ALL(Table), Table[Month] < MAX(Table[Month])))
return
CALCULATE(SUM(Table[Load Volume]) , FILTER(ALL(Table) ,Table[Month] = _PreviousMonth))

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Anonymous
Not applicable

Hello for some reason I am not getting the previous value

aj1973
Community Champion
Community Champion

Hi @Anonymous 

Please add a column Order(for Month order) to your table and use

aj1973_0-1634656924562.png

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

@Anonymous 

you need to have a date column

Previous = maxx(FILTER('Table','Table'[Date]=EDATE(EARLIER('Table'[Date]),-1)),'Table'[Load Volumn])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.