cancel
Showing results 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

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

7 REPLIES 7
Frequent Visitor

Hi @selimovd

Can you help me on this issue?

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

Thanks

Super User

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

Frequent Visitor

Hi @selimovd
https://we.tl/t-vHCzwVjX8W

TIA

Super User

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

Frequent Visitor

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
DATESBETWEEN('Sales Report'[Installation Date],
DATE(YEAR(TODAY()),MONTH(TODAY()),01),TODAY()
)
)

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

TIA

Impactful Individual

Try this measure:

PREMIUN SPLM=

PREVIOUSMONTH(DATESMTD('Calendar'[Date])))

Kudos are always appreciated.
Thanks
Frequent Visitor

Hi @Tanushree_Kapse,

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

Thanks

Announcements

#### 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 Monthly Update - June 2024

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

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

Top Solution Authors
Top Kudoed Authors