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.
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?
Solved! Go to 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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |