Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hello All!!!
I've looked around a bit and haven't had much luck finding help on this.
I have 2016 and 2017 Sales Data. I have InvoiceDate and Sales as my main columns. I'd like to be able to compare say Weekend Ending 3-25-17 to the comprabable Week Ending in 2016, which is 3-26-16. I am able to figure out how to get Week Number but I haven't been able to figure out a good way to use SamePeriodLastYear by week number. Or can I even use that?!?!
Any suggestions/help/advice would be greatlly appreciated!
Thanks!
R
Solved! Go to Solution.
Build your calculations for this year and for last year. Then create a growth calculation: This year - Last Year.
After you create the totals it is a simple matter to put week numbers on rows or on the axis.
Total Sales = SUM(Sales[Line Sales])
Last Year Sales = CALCULATE([Total Sales], DATEADD(Date[Datekey], -1, year))
Growth = [Total Sales]-[Last Year Sales]
Make sure your report/page is filtered to the current year for the last year calculation to work. Then, if you would like, you can use your weeknumber as a filter as well. For example this week I would set my week number filter to be less than 15.
Proud to be a Super User!
Hi @RAdams
Please check out the link
https://www.sqlbi.com/articles/week-based-time-intelligence-in-dax/
If it works for you please accept this as a solution and also give KUDOS.
Cheers
CheenuSing
@CheenuSing Thanks for taking the time to share the link. I looked through a couple times and I'm still a bit confused.
Should I use filters to compare Previous and Current Years? If so, how do I use Week Numbers in the filters?
Thanks again for your time.
R
Build your calculations for this year and for last year. Then create a growth calculation: This year - Last Year.
After you create the totals it is a simple matter to put week numbers on rows or on the axis.
Total Sales = SUM(Sales[Line Sales])
Last Year Sales = CALCULATE([Total Sales], DATEADD(Date[Datekey], -1, year))
Growth = [Total Sales]-[Last Year Sales]
Make sure your report/page is filtered to the current year for the last year calculation to work. Then, if you would like, you can use your weeknumber as a filter as well. For example this week I would set my week number filter to be less than 15.
Proud to be a Super User!
Awesome. A simple explanation is all I needed! I was way over complicating it!
R
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |