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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
D_P
Frequent Visitor

Add Column: conditional statement and numeric parameter

I created a numeric parameter that allows the user to choose a value between 0 and 20.

D_P_2-1691749640556.png

 

D_P_1-1691749615957.png

And a measure that tells me what number was chosen:

D_P_3-1691749692817.png

I have a table Product and I want to add a column that gives me the new price.

D_P_4-1691750478146.png

The column New Price should mantain the price for products B and C, and attribute a new price for product A that correspondes to the current price in table Product multiplied by the 'ChosenNumber'.
This is the result:

D_P_5-1691750757561.png

As you can see, for product A the new price is blank.

6 REPLIES 6
Dhairya
Solution Supplier
Solution Supplier

Hey @D_P Can you please share expected output?

 

D_P
Frequent Visitor

Assuming that this was the user input:

D_P_4-1691754086073.png

 

The expected output was:
D_P_3-1691754051233.png

 

Dhairya
Solution Supplier
Solution Supplier

Hey @D_P
Instead of creating a calculated column, create a measure using the below code

New Price = 
IF(
    SELECTEDVALUE(TableA[Name]) = "A",
    CALCULATE(Parameter[Parameter Value] * SELECTEDVALUE(TableA[Price])),
    MAX(TableA[Price])
)

You will get the following output

Dhairya_0-1691839826276.png

If this helps you then please give it a kudo and mark my solution as accepted so that other can find it quickly on facing similar issue. Thank You!

D_P
Frequent Visitor

Hi PowerBI wizard @Dhairya!
Thank you for the solution provided.
But on this specific case I really need it to be a calculated column.
Any other cards on your sleeve?

ToddChitt
Super User
Super User

I don't think you can use a Measure in this type of Column calculation. If you swap out [ChosenNumber] for a literal value, it will show proper results, right?




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





D_P
Frequent Visitor

Yes, you're right. But I need it to be dinamic, meaning, I need to be able to change it here

D_P_2-1691753908331.png

And see it reflected on the Product table.

Do you have any other suggestions on how this can be achieved?
Thanks in advance.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.