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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
mamunabdullah
Frequent Visitor

Calculating Same Period Last Month !!!

Hi Geniuses, 

 

I have created a measure to calculate MTD sales of my product category now I want to calculate sales of same premiod last month to compare. My Dax formula is returning the same result as current month MTD. 

PREMIUN SPLM = CALCULATE([MTD PREMIUM Sales],
DATESBETWEEN('Calendar'[Date],DATE(YEAR( TODAY() ), MONTH( TODAY() )-1, 01), TODAY()-30 )
)

Can you please help me how I can fix this?
 
mamunabdullah_0-1632750306076.png

 

 

7 REPLIES 7
mamunabdullah
Frequent Visitor

Hi @selimovd

Can you help me on this issue? 

Here is my PBI file: https://we.tl/t-X49Va7dzNP

Thanks 


Hey @mamunabdullah ,

 

is that still ongoing or could you solve the issue?

If it's still unsolved you have to upload the file again as it expired.

 

Best regards

Denis

Hi @selimovd 
Here's the link, 
https://we.tl/t-vHCzwVjX8W

 

TIA

Hey @mamunabdullah ,

 

I downloaded the file and don't see anything you showed on the first post in the file.

Can you explain again what you are trying to do, what is the result and what you expect as a result?

 

Maybe prepare the file, that I only have to open it and see your case.

 

Best regards

Denis

Hi @selimovd,

 

Sorry I might have renamed those measures which makes them difficult for you to understand !

Below measure #1 is what returns the sales quantity in current month and measure #2 is what I expect to return sales quantity of same period last month and change in percentage. 

 

Measure #1
MTD PREMIUM Sales Installed =
CALCULATE([PREMIUM Sales],
DATESBETWEEN('Sales Report'[Installation Date],
DATE(YEAR(TODAY()),MONTH(TODAY()),01),TODAY()
)
)

 

Measure #2
MTD PREMIUM Sales SPLM =
VAR SPLM = CALCULATE([MTD PREMIUM Sales Installed],PARALLELPERIOD('Calendar'[Date],-1,MONTH))
RETURN
DIVIDE([MTD PREMIUM Sales Installed]-SPLM,SPLM)
 

mamunabdullah_0-1634578666402.png

TIA



Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @mamunabdullah ,

 

Try this measure:

 

PREMIUN SPLM=  

CALCULATE([MTD PREMIUM Sales],
PREVIOUSMONTH(DATESMTD('Calendar'[Date])))
 
Mark this as a solution if I answered your question.
Kudos are always appreciated.
Thanks

Hi @Tanushree_Kapse,

It didn't work either. Returned the same value as current month. 

Thanks 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors