Forum Discussion
antonio_wurth
2 years agoHelper I
dynamic parameters and names
hello general idea: have a filter for "calendar_year" when choosing some year, for example 2023 chart below should calculate YTD for 2023 and YTD for 2022 legend should change to 202...
- 2 years ago
Hi antonio_wurth
This happens because your parameters are based on today and not on selected years.
So no matter what you choose, the parameter will be the year of today or previous to today.
As an alternative, you can use a disconnected years table and dynamic measure.Dynamic_sales = if(ISFILTERED('dim_date'[calendar_year]),if(SELECTEDVALUE('Years'[Years])=max('dim_date'[calendar_year]),[sales_ytd],if(SELECTEDVALUE('Years'[Years])=max('dim_date'[calendar_year])-1,[sales_ytd_py])),"")Or just use The years of your date table as a legend with 1 measurepbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
antonio_wurth
2 years agoHelper I
thank you!
- Ritaf19832 years agoSuper User
You're welcome 🙂