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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

New column based on criteria

Hi.
I have this table (a lot bigger, but just simplifying it), and a want to create a new column that is called "New provision fee %".
The provisionfee for order number O1 and O2 should really be 8, and the rest should be 10 (unchanged). Could somone help me with a formula for this column? Or is it possible to go and edit the data table precentages manually in some way?

NorthernKarsten_0-1612519608817.png

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , A new column like

 

if([order number] in {"O1", "O2"}, 8,10)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

timg
Solution Sage
Solution Sage

Hi,

If you want to do this in Dax you could use the following formula:

 

NewProvisionPerc =
SWITCH (
    TRUE (),
    TestTable[Order number] IN { "O1", "O2" }, 8,
    TestTable[Provision%]
)

 

1.PNG

However, if possible you might want to solve this in the data source, or in Power query, since the DAX method will add a new column to your model next to the old one (unnecessary bulk). Via Power Query you could solve it with a conditional column. Once you have this new column the old one can be removed:

2.PNG

Hope that helps!

Regards,

Tim





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , A new column like

 

if([order number] in {"O1", "O2"}, 8,10)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
timg
Solution Sage
Solution Sage

Hi,

If you want to do this in Dax you could use the following formula:

 

NewProvisionPerc =
SWITCH (
    TRUE (),
    TestTable[Order number] IN { "O1", "O2" }, 8,
    TestTable[Provision%]
)

 

1.PNG

However, if possible you might want to solve this in the data source, or in Power query, since the DAX method will add a new column to your model next to the old one (unnecessary bulk). Via Power Query you could solve it with a conditional column. Once you have this new column the old one can be removed:

2.PNG

Hope that helps!

Regards,

Tim





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

Proud to be a Super User!




Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Users online (25)