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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.