Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
I'm stuck and hope the community can help me.
Simple problem. A table contains:
Fruit Value
Orange 10
Apple 4
Banana 20
Strawberries 7
I have a % parameter (so 0% to 100%) which is selected by the user.
I need a new column with the logic of:
If Fruit = Orange then (Value * % parameter + 10) or;
If Fruit = Apple then (Value * % parameter + 5) or;
If Fruit = Banana then (Value * % parameter + 2)
otherwise return Value
I relatively new to PowerBI so am struggling with nested IF searching for texts and returning a formula. I've looked at many examples but currently haven't got it.
All help welcome. Thanks a lot in advance.
Solved! Go to Solution.
Hi @Anonymous
try this technique
Measure =
var _parameter = DIVIDE(SELECTEDVALUE('Table'[Parameter]), 100)
var _fruit = SELECTEDVALUE('Table'[Fruit])
var _valueParameter = SELECTEDVALUE('Table'[Value])*_parameter
RETURN
SWITCH(TRUE(),
_fruit = "Orange", (_valueParameter + 10),
_fruit = "Apple", (_valueParameter + 5),
_fruit = "Banana", (_valueParameter + 2)
)
Hi @Anonymous
try this technique
Measure =
var _parameter = DIVIDE(SELECTEDVALUE('Table'[Parameter]), 100)
var _fruit = SELECTEDVALUE('Table'[Fruit])
var _valueParameter = SELECTEDVALUE('Table'[Value])*_parameter
RETURN
SWITCH(TRUE(),
_fruit = "Orange", (_valueParameter + 10),
_fruit = "Apple", (_valueParameter + 5),
_fruit = "Banana", (_valueParameter + 2)
)
Thank you for the superfast reply! Yes, the format with some tweaking worked and I learnt a lot on the way.
Really appreciated!
Actually, sorry still stuck. When I use the following with a a whatif parameter, the correct values are returned.
@Anonymous
sorry, I do not understand the issue
also, please set @ in message and choose my login in drop down list to notify me about reply
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 19 | |
| 12 | |
| 10 |