Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
I am trying to create a measure that calculates the "amount" same period last year. Like below
_A_PY =
return final
however it gives me same values for current and previous year
Could you please explain what wrong am I doing?
Thanks
Priya
Hi @priyanath1988 ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2)We can create a table.
CALENDAR = CALENDAR(DATE(2021,1,1),DATE(2022,12,31))
(2) We can create two measures.
Measure = CALCULATE(SUM(A[Amount]),FILTER('A','A'[Country]="USA"))
_A_PY = CALCULATE('A'[Measure], SAMEPERIODLASTYEAR('CALENDAR'[Date]))
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-tangjie-msft Thank you so much for your response. I will apply this and let you know!
Please follow this link
https://radacad.com/same-period-last-year-to-date-dax-calculation-in-power-bi
Regards,
Ritesh
User | Count |
---|---|
89 | |
85 | |
66 | |
62 | |
57 |
User | Count |
---|---|
138 | |
112 | |
94 | |
82 | |
71 |