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've been looking into the YTD topic calculations but none of the solution works for my situation.
My formula is as follow:
YTDRevenue = TOTALYTD(sum('P&L'[Revenue]),'Calendar'[Date],all('P&L'[GL_DATE]),"3/31")
LastYearYTDRevenue = CALCULATE(SUM('P&L'[Revenue]), SAMEPERIODLASTYEAR('Calendar'[Date]))
I also tried a slightly different formula for the LastYearRevenue:
LastYearYTDRevenue = CALCULATE([YTDRevenue], SAMEPERIODLASTYEAR('Calendar'[Date]))
However, both formula for LastYearRevenue yield me the whole revenue amount for last year, not the YTD last year revenue amount.
I've also tried DATESYTD and DATESADD syntax as well, but it's not working as well.
The FY cut off is from Apr to Mar, not Jan to Dec.
Calendar table is as follow:
Calendar Date | Month | Quarter | FY |
4/1/2019 | Apr-19 | Q1 | FY19 |
4/2/2019 | Apr-19 | Q1 | FY19 |
4/3/2019 | Apr-19 | Q1 | FY19 |
4/4/2019 | Apr-19 | Q1 | FY19 |
4/5/2019 | Apr-19 | Q1 | FY19 |
4/6/2019 | Apr-19 | Q1 | FY19 |
4/7/2019 | Apr-19 | Q1 | FY19 |
4/8/2019 | Apr-19 | Q1 | FY19 |
4/9/2019 | Apr-19 | Q1 | FY19 |
4/10/2019 | Apr-19 | Q1 | FY19 |
4/11/2019 | Apr-19 | Q1 | FY19 |
4/12/2019 | Apr-19 | Q1 | FY19 |
The P&L table is as follow:
GL_DATE | Revenue |
3/4/2018 | 1,600 |
6/5/2018 | 4,000 |
9/9/2018 | 2,000 |
6/1/2019 | 5,000 |
3/3/2019 | 3,500 |
4/26/2019 | 100 |
5/27/2019 | 1,000 |
7/13/2019 | 30,000 |
9/13/2019 | 2,000 |
10/13/2019 | 30,000 |
The expected result I should get is: YTD Revenue = 63,100 ; Last Year YTD Revenue = 7,600. However, I keep getting Last Year YTD Revenue = 16,100.
Appreciate your help on this. Thanks.
Hi @Keropi79 ,
try changing your measures as below
YTDRevenue = TOTALYTD(sum('P&L'[Revenue]),'Calendar'[Date],all('Calendar'[Date]),"3/31")
YTDRevenueLY = Calculate([YTDRevenue], SAMEPERIODLASTYEAR('Calendar'[Date]))
Use 'Calendar'[Date] column in your visuals as dimension and check if you are getting results as you need
Thank you,
Washivale
I tried this before, it's not working. If I change YTD to use the 'Calendar'[Date], my visualization will not generate anything, it'll just give the error message 'Something's wrong with one or more fields'.
Same case if I try to use the 'P&L'[GL_Date] for YTDRevenueLY syntax.
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 |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |