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.
Hello All,
First Post Here.
My question pertains to calculating YTD sales for the current and the previous year.
I've seen other posts regarding the following formula: Total Sales LY = CALCULATE(SUM('Sales'[Today sales]), SAMEPERIODLASTYEAR('Date'[Date]))
However, it seems this assumes that the Prior Year data and current year data are in the same table.
Is it possible to this calculation with 2 seperate tables one for CY and one for PY so that when i filter on the first 2 quarters it shows Q1 & Q2 of '17 and '18?
Alex
Hi @dahdouhap
Yes, its possible . Assumeing that , your current year data in Table1, and last year data in Table2, then you can uset he below formula for LY.
Total Sales LY = CALCULATE(SUM(Table2[sales]), SAMEPERIODLASTYEAR('Date'[Date]))
Primiarily the filter is applied on your data table and then it flows to the table. Filter on Date differentaites the CY, LY values, not on the fact table.
Thanks
Raj
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |