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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
leroy773
Helper II
Helper II

new column that calculates value of a row based on text in the row

All,

 

I am attempting to add an if function to a column to calculate quantity of a row based on part description.  I have tried search and contains functions to no success.  Anytime the part name contains partial I would like to multiply by one. since all other parts are whole, would like to multiply by 4.  Any feedback will be appreciated.

 

Part NameQtyTotal
a, partial1='Qty'*1
a, whole.5='Qty'*4
b, partial1='Qty'*1
b, whole.75='Qty'*4
1 ACCEPTED SOLUTION
Anonymous
Not applicable

 

@leroy773  working fine for me: please use in the calculated column

 

 

CM.PNG

 

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

 

@leroy773 

Calculated column measure :

 

Measure=SWITCH(TRUE(),FIND("partial",[Part Name],1,0)>=1,[Qty]*1,[Qty]*4)

 

 

Thank you for the prompt feedback, that calculation multiplies all qty by 1, even when partial is in the part name.  Any other thoughts.

Anonymous
Not applicable

 

@leroy773  working fine for me: please use in the calculated column

 

 

CM.PNG

 

Thanks that worked, not sure why it did nto work.  Must of entered something incorrectly

 

Anonymous
Not applicable

Have U used this Measure: Measure=SWITCH(TRUE(),FIND("partial",[Part Name],1,0)>=1,[Qty]*1,[Qty]*4)
amitchandak
Super User
Super User

@leroy773 , Create a new column like

New column = [Qty] * Switch( True(), [Name] = "partial" , 1, [Name] ="whole",4,1)

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
camargos88
Community Champion
Community Champion

Hi @leroy773 ,

 

Try this column on Power Query:

if Text.Contains([Part Name], "partial") then 1 else 4 * [Qty]

 

Capture.PNG 



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

Proud to be a Super User!



Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors