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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
AdamMetz23
Advocate I
Advocate I

How to use DAX formula SELECTEDVALUE with Field Parameters

Dear Power BI community,

 

I would like to ask for your help as I am trying to use DAX formula SELECTEDVALUE based on field parameters, however it is not doable based on the following error message:

AdamMetz23_0-1677489956714.png

 

IF user selects between two value the (Amount USD & Amount LCL) the calculation should be changing based on that:

DAX formula :

AdamMetz23_1-1677490209440.png

 

Field Parameter:

AdamMetz23_2-1677490237278.png

 

Visualization selection for Amount USD & Amount LCL:

AdamMetz23_3-1677490307581.png

 

 

Would it be possible for someone to help how to change the DAX formula SELECTEDVALUE part to make it work?

Thank you for your advice in advance.

 

Wishing you a wonderful date.

 

Adam

 

 

 

2 ACCEPTED SOLUTIONS
andhiii079845
Solution Sage
Solution Sage

Can you perhaps upload a example file without sensitve datas? 
Other post to field parameters 
It seems to be possible. Perhaps try first to access only to the field parameter value? 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Did you try to add a "calculate" in the var Lastyeardynamic:
Lastyeardynamic = calculate(max(DWH[year])) ? 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

7 REPLIES 7
andhiii079845
Solution Sage
Solution Sage

What was the solution now in your case ? 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I have added the year column values explicitly instead of using a MIN & MAX measure to find the first and last year in the year column.

 

I am not 100% clear how it connects to the original issue to be honest but solved the problem.

 

AdamMetz23_0-1677501679722.png

 

Did you try to add a "calculate" in the var Lastyeardynamic:
Lastyeardynamic = calculate(max(DWH[year])) ? 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Oh thank you I have added calculate and it made the formula more dynamic. Thank you.

andhiii079845
Solution Sage
Solution Sage

Can you perhaps upload a example file without sensitve datas? 
Other post to field parameters 
It seems to be possible. Perhaps try first to access only to the field parameter value? 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




andhiii079845
Solution Sage
Solution Sage

One question: Why it is important to use field parameters instead of a regular table / calculated table? 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you Andhi for your quick reply.

 

Actually the main reason for that is that this was the only way (based on my knowledge) how I could dynamically change the column chart visualization Y axis between amount usd and amount lcl based on the field parameter selection:

AdamMetz23_0-1677491582316.png

 

Is it inefficient to do so?

Thank you,

Adam

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.