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.
I'm trying to build a report that shows annual metrics (sales, orders, etc.) going back several years. For each prior year I would like to show the metrics not just for the complete year, but also for the same period as the current year. So, if the current year happens to be through day 275 of the year, I'd like to show the metric values for each prior year through day 275. I've added a day-of-year value to my Dates table and attempted to utilize that with no luck . I've also tried the Measure:
Solved! Go to Solution.
After being repeatedly thwarted by the Time-Intelligence functions I had to brute-force a solution. Again, I added a column to my Dates table for Day-of-Year. Inelligant although my soluion may be, it works. Typically you'd place a +1 after the DATEDIFF call but our data posts through the previous day so it works as written:
After being repeatedly thwarted by the Time-Intelligence functions I had to brute-force a solution. Again, I added a column to my Dates table for Day-of-Year. Inelligant although my soluion may be, it works. Typically you'd place a +1 after the DATEDIFF call but our data posts through the previous day so it works as written:
Hi,
If your Dates table goes only till today's date, then then measure should work
YTD Prev Sales = CALCULATE([Total Sales],SAMEPERIODLASTYEAR('Dates'[Date]))
as I mentioned in my original post. Although I tried DATESYTD, I've also tried SAMEPERIODLASTYEAR and again, it only gives the value for the most recent Year (doesn't go year-by-year) and displays the value in the Totals row.
I'll need to see your file. Share the download link and show your expected result.
Hello, try something like this:
Sales Amount Cumulative :=
VAR LastVisibleDate = MAX ( 'Date'[Date] )
VAR FirstVisibleDate = MIN ( 'Date'[Date] )
VAR LastDateWithSales = CALCULATE ( MAX ( 'Sales'[Order Date] ))
VAR Result =
IF ( FirstVisibleDate <= LastDateWithSales,
CALCULATE (
[Sales Amount],
'Date'[Date] <= LastVisibleDate))
RETURN
Result
if you put that on a chart and with year in the legend and say week number or month name in the axis you sould be all good
No joy. Just gives me each year's total sales. My Dates table is built from the Sales table so only includes dates between the date of the company's first sale and most recent sale.
oh, you need a proper date table. Make one of those first.
DateTable=CALENDARAUTO()
I have a 'proper' Date table covering all dates between the company's first and most recent purchases.
@jtma508 You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
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 |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |