cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dopper156
Frequent Visitor

Changing a column value based on a parameter

Hi all,

 

I am looking to do the following:

 

1. Create a list based parameter, so a list of manually entered values. It seems this is only doable at the data source level, which is a bit shocking to me. At the report level there are only what-if (limited numeric based) parameters.

2. Have a calculated field change dynamically based on whatever is chosen in that parameter. For example:

 

Say you have a list parameter, one choice is US Dollars, one choice British Pounds. The column (measure) would be something like this:

 

IF(currency_chosen_parameter = "US Dollars", dollars_in_US, dollars_in_british)

 

So basically have the measure change dynamically based on the value chosen in the parameter (note that while my example included changing a currency, my real life example is very different). 

 

I am shocked that Power BI doesn't seem to have that capability. List parameters are done at the source level, and you can't seem to change a (calculated) measure value based on the value chosen in a list parameter. Am I missing something?

 

 

Bonus question - is it possible to dynamically change a data type? For example, make it currency if it's over 1, else make it a %. Has anyone found a workaround for this kind of thing? 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@dopper156 , A calculated column can not use slicer value, that is limiatation. But measure can.

 

Measure slicer is an example of that- Measure Slicer: https://www.youtube.com/watch?v=JLkKTJrdv04&list=PLPaNVDMhUXGYzjFASXjdY7GNoFxvlkR54&index=19

 

Field parameter take it next level, where you shift column on-axis or measure in values

 

https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

View solution in original post

2 REPLIES 2
dopper156
Frequent Visitor

Thank you for this! Btw, it looks like field parameters are not available to add via options. Does that mean my Power BI version is old?

amitchandak
Super User
Super User

@dopper156 , A calculated column can not use slicer value, that is limiatation. But measure can.

 

Measure slicer is an example of that- Measure Slicer: https://www.youtube.com/watch?v=JLkKTJrdv04&list=PLPaNVDMhUXGYzjFASXjdY7GNoFxvlkR54&index=19

 

Field parameter take it next level, where you shift column on-axis or measure in values

 

https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show episode 9

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors