Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello everyone,
I have sales data for all of 2021 and through October for 2022. I'm trying to get sales from 2021 through to the latest date in 2022.
For a start, I tried this method:
Sales YTD = TOTALYTD(SUM('Sales'[Sales Amount]), 'Date'[Date])
-- that sums up the whole year 2022
YTD Sales LY = CALCULATE([YTD Sales], SAMEPERIODLASTYEAR('Date'[Date] ))
-- The latter returns me the sum of all the rows of 2021
The 2nd method, I tried this other rule:
Sales = SUM('Sales'[Sales Amount])
Sales YTD = TOTALYTD(Sales, 'Date'[Date])
Sales LY = CALCULATE([Sales], SAMEPERIODLASTYEAR('Date'[Date] ))
Sales YTD = TOTALYTD([Sales LY]), 'Date'[Date])
And a 3rd too
Sales = CALCULATE(SUM('Sales'[Sales Amount]), DATESYTD('Date'[Date]))
Sales LY YTD = CALCULATE([Sales], SAMEPERIODLASTYEAR('Date'[Date] ))
but unfortunately both don't work.
help me
Hi @alsolok ,
What's your expected result? Could
Sample data.
And I tried your first method, it seems work.
If not, please tell me what the correct expected result should look like.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@alsolok you can apply YTD date filter to show only YTD dates. if you have date table, you can create below calc column
Days_for_Year = DATEDIFF(STARTOFYEAR('Calendar'[Date]),'Calendar'[Date],DAY)+1
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
85 | |
65 | |
51 | |
45 |
User | Count |
---|---|
217 | |
88 | |
81 | |
65 | |
56 |