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'm trying to apply a sameperiolastyear function but is not working, this is my DAX:
Solved! Go to Solution.
Hi @JEM_Systems ,
I suggest you to create a calendar table with continuous date by CALENDAR()/CALENDARAUTO() function.
Calendar = ADDCOLUMNS(CALENDARAUTO(),"Year",YEAR([Date]))
Measure:
LY Sales = CALCULATE(SUM('Table'[Sales]),SAMEPERIODLASTYEAR('Calendar'[Date]))
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @JEM_Systems - we would need a lot more info than that. How specifically is it not working? What kind of error does it return? Providing screenshots would help
Hi @JEM_Systems ,
I suggest you to create a calendar table with continuous date by CALENDAR()/CALENDARAUTO() function.
Calendar = ADDCOLUMNS(CALENDARAUTO(),"Year",YEAR([Date]))
Measure:
LY Sales = CALCULATE(SUM('Table'[Sales]),SAMEPERIODLASTYEAR('Calendar'[Date]))
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
96 | |
95 | |
82 | |
71 | |
64 |
User | Count |
---|---|
115 | |
105 | |
95 | |
79 | |
72 |