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

Comparing full current month of last year's sales

Hello,

Our sales team receives a report every week showing the YTD, Last Year YTD, MTD and LY MTD sales, but they would like to see the sales of the whole current month of last year instead of MTD.
Does anyone know how I could do that in a dynamic way?

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@marianamarques

 

If you want to calculate same month last year total, you just need to use PARALLELPERIOD() function and set the interval on month level.

 

= CALCULATE(SUM('Table'[Amount]),PARALLELPERIOD('Table'[Date],-12,MONTH))

Regards,

 

View solution in original post

2 REPLIES 2
v-sihou-msft
Employee
Employee

@marianamarques

 

If you want to calculate same month last year total, you just need to use PARALLELPERIOD() function and set the interval on month level.

 

= CALCULATE(SUM('Table'[Amount]),PARALLELPERIOD('Table'[Date],-12,MONTH))

Regards,

 

NielsJ
New Member

Hello,

 

I am fairly new to Power BI so bear that in mind. You could create a column that looks at the month you're in and marks the data in or out. If your data set is updated each day with the current sales it would show the total current months sales for each year and only (Obviously) the MTD sales current year.  

 

Step 1: Create new column.

 

Step 2: Paste the following DAX: IsCurrentMonth = IF(MONTH(Sales[Posting Date]) = MONTH(TODAY()); "Yes"; "No")

 

Step 3: Filter the page or visuals with the column "Yes".

 

I hope this is the answer you are looking for.

 

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.