Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
antonio_wurth
Helper I
Helper 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 2023 and 2022 as well

 

but for now

numbers - are changing(all good)

but legend always same 2024-2023(if if number are for 2023-222)

 

link to pbix file dynamic_names

 

 

antonio_wurth_0-1704368806096.png

 

help please

 

 

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

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.

Ritaf1983_0-1704434272753.png

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])),"")
Ritaf1983_1-1704434393433.png
Or just use The years of your date table as a legend with 1 measure
Ritaf1983_2-1704434565758.png

pbix is attached

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
antonio_wurth
Helper I
Helper I

thank you!

You're welcome 🙂

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Ritaf1983
Super User
Super User

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.

Ritaf1983_0-1704434272753.png

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])),"")
Ritaf1983_1-1704434393433.png
Or just use The years of your date table as a legend with 1 measure
Ritaf1983_2-1704434565758.png

pbix is attached

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.