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 am struggling to find a way to compare a true total of sales for last year to current date this year.
I am using the "sameperiodlastyear" function, but it returns the entire total for last year.
PYTD Sales = CALCULATE([Total Sales],SAMEPERIODLASTYEAR('Unlabeled Jarred Goods Sales'[Date].[Date]))
I need to show the total of sales up to the last date of the current years sales.
Any thoughts?
Solved! Go to Solution.
Hi @DarylM,
Please try this formula:
PYTD Sales = CALCULATE ( [Total Sales], PARALLELPERIOD ( LASTNONBLANK ( 'Unlabeled Jarred Goods Sales'[Date], 1 ), -1, YEAR ) )
If you have any question, please feel free to ask.
Thanks,
Yuliana Gu
Hi @DarylM,
Please try this formula:
PYTD Sales = CALCULATE ( [Total Sales], PARALLELPERIOD ( LASTNONBLANK ( 'Unlabeled Jarred Goods Sales'[Date], 1 ), -1, YEAR ) )
If you have any question, please feel free to ask.
Thanks,
Yuliana Gu
To elaborate, I am date product sales 1/1/15 through 10/25/16. I need to show the sales for 2015 up to 10/25. These dates will continue to populate as we go through the year. I am having trouble finding a way to calculate this with DAX.
Hi,
as long as you only compare years I have a solution here. In this thread I am looking for a solution that also works with months, quarters etc as well.
Sammy
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |