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
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
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.