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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi I am struggling with this:
I need a new column in my model where I have the correct suppliers discount. There is a column SUPDISC but there are exceptions. So there are two columns that have an effect on SUPDISC: 1= SUPPLIER 2 = SHOP. Now what I want is something like:
if supplier = COCACOLA and SHOP = AMSTERDAM then the discount should be 65.00,
if supplier = PEPSICOLA and SHOP = ROTTERDAM then the discount should be 60,00,
in all the other occasions the value from SUPDISC must be applied.
Hope somebody can help me. Many thanks in advance
@BartVlek , a New column like
Switch ( true(),
[supplier] = "COCACOLA" && [SHOP] = "AMSTERDAM" , 65.00,
[supplier] = "PEPSICOLA" && [SHOP] = "ROTTERDAM" , 60.00,
[SUPDISC]
)
Same can be done with IF
Thank you !! And what does it look like when the name of the new column should be SUPDISCDEF?
@BartVlek , not sure what you mean by that. A new column like
SUPDISCDEF =
Switch ( true(),
[supplier] = "COCACOLA" && [SHOP] = "AMSTERDAM" , 65.00,
[supplier] = "PEPSICOLA" && [SHOP] = "ROTTERDAM" , 60.00,
[SUPDISC]
)
I transformed your suggestion to the actual situation. The shop doesn't have a name, but a number as you can see.
When I then copy-paste it to PBI-desktop and run, I receive a syntaxis error. What can it be? Do I not need to add the name of the table?
LEVKORTDEF =
SWITCH (
TRUE (),
[LEVERANCIER] = "ALDIPRESS"
&& [FIL] = "1", 65.00,
[LEVERANCIER] = "BETAPRESS"
&& [FIL] = "1", 60.00,
[LEVKORTING]
)
Hi @BartVlek ,
Please try to update the formula of your measure as below to remove double quotation since shop is number type:
LEVKORTDEF = SWITCH ( TRUE (), [LEVERANCIER] = "ALDIPRESS" && [FIL] = 1, 65.00, [LEVERANCIER] = "BETAPRESS" && [FIL] =1 , 60.00, [LEVKORTING] ) |
If the above method didn't resolve your problem, please provide the screen shot of syntax error and related formula. Thank you.
Best Regards
Rena
Thank you !
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.