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
leebm
Regular Visitor

Compare MTD with previous period

 

Hi, I want to compare actual sales (running value) with sales in the same month last year. This should be shown in a Table and grouped by sales representative.

I have a fact table with the sales value per order and a date. Since the date in the fact table is not continuous I created a date-table and set up a relationship I created several measures:

 

Sales MTD = CALCULATE([Total Sales]; DATESMTD(Time[Date]))

Sales YTD = CALCULATE([Total Sales]; DATESYTD(Time[Date]))

Sales MTD last year = CALCULATE([Sales MTD]; SAMEPERIODLASTYEAR(Time[Date]))

Sales YTD last year = CALCULATE([Sales YTD]; SAMEPERIODLASTYEAR(Time[Date]))

 

I added a filter for month and year to the visualisation table, without a filter no data is shown. This works OK for the actual period, but not for the last period. Today the table should show all sales from 1. Of March to 24. Of march, which is OK, but for the last period it shows the sales from 1. To 31. Of March last year. – but I want to compare the exact period of time.

What am I missing?

 

1 ACCEPTED SOLUTION

I finally solved it: I filter my measure with the datesbetween function. I created a measure for the beginning of the month last year (eomonth function) and another for the actual date (=EDATE(TODAY);-12)

This way I have always the actual month compared to the month last year, even if the month is not yet finished.

 

View solution in original post

19 REPLIES 19

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.