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 Guys - I was wondering if someone could perhaps help.... I've spent a day on this, read just about every forum post, but I'm clearly missing something in relation to the SAMEPERIODLASTYEAR function.
Details:
I have a Transaction DB - Consumed into PowerBi via Odata
I have a seperate Calendar DB I created in PowerBi (Well formed)
On the transaction DB - I have created the following measures:
Sum of Sales --> Sum of Sales = SUM (Transactions[amount])
Year to Date Sum of Sales --> YTDSumOfSales = TOTALYTD([Sum of Sales],'CALENDAR'[Date])
Last Year Sales --> SalesLastYTD = CALCULATE([YTDSumOfSales], SAMEPERIODLASTYEAR('CALENDAR'[Date]))
For some reason the Last Year Sales Measure is moving the measure ahead; instead of behind (IE - 2018, insted of 2016) - Here is what the table of the data looks like the below.
Essentially I am trying to create some KPI Scorecards to show you how you are trading against Last YTD / Last MTD / Last WTD / This Week vs Last Year This Week / Today vs Today Last Year.
Any direction would be well recieved!
Solved! Go to Solution.
Not sure what you mean. Results look as expected. 2017 SalesLastYTD is showing 2016 YTDSumOfSales, etc.
Not sure what you mean. Results look as expected. 2017 SalesLastYTD is showing 2016 YTDSumOfSales, etc.
Thanks for pointing out the obvious to me. I ended up going in circles; and getting confused with the Sameperiodlastyear / parrallelperiod / dateadd..... But I realised I was being stupid, and after reading a few more articles, i figured it out.
This really helped:
https://www.kasperonbi.com/powerpivot-dax-parallelperiod-vs-dateadd/
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 |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |