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 All
how can i create a dynamic previous year sales
E.g if i select 2015, i need to retrieve 2014 sales, if i select 2014, i need to retrieve 2013 sales. Also note my financial year ends on 31st March.
I have tried with below DAX Function , but it didnt not work
1.
PreviousYearbySelection
VAR CurrentYear=
CALCULATE(FIRSTNONBLANK('Z_Power BI Date Template'[Year], ISFILTERED('Z_Power BI Date Template'[FinancialYear]) ))
Return
CurrentYear-1
2.Sales_Previous_Year_Selection =
CALCULATE
(sum
('Sales Comparison'[BaseSubTotal]),
filter ('Z_Power BI Date Template','Z_Power BI Date Template'[Year]=[PreviousYearbySelection]
)
)
Have you tried SAMEPERIODLASTYEAR ?
E.g.
Calculate(
(sum
('Sales Comparison'[BaseSubTotal]); SAMEPERIODLASTYEAR("yourdatetable";[date])
)
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 | |
102 | |
88 | |
63 |