Forum Discussion
LAG FUNCTION DAX
Hi,
I would recommend doing this using measures but here is a calculated column example:
Example data:
Calculated column:
Measure example for this year BP:
Hi ValtteriN,
Thank you for the above, would it possible for you to drop the powr bi file that you did the example in here
Thanks
Zaynah
- ValtteriN4 years agoCommunity Champion
Hi,
Unfortunately I am not able to provide the pbix file.- Anonymous4 years agoNot applicable
Hi Zaynah16 ,
Could you please share some sample data (exclude sensitive data) and your expected result with calculation logic and special examples in order to make troubleshooting and provide you a suitable solution? It is better if you can provide a simplified pbix file. Thank you.
In addition, it seems that you are trying to get the difference between the current year and the previous year and then do the rest of the calculations based on your description. If that is the case, you can refer to the following blog to implement it.
How to compare Last year and Current Year sales in Power BI?
CREATING A POWER BI CHART COMPARING EACH YEAR VS PREVIOUS YEAR
Best Regards