Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 Name | Qty | Total |
a, partial | 1 | ='Qty'*1 |
a, whole | .5 | ='Qty'*4 |
b, partial | 1 | ='Qty'*1 |
b, whole | .75 | ='Qty'*4 |
Solved! Go to Solution.
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.
Thanks that worked, not sure why it did nto work. Must of entered something incorrectly
@leroy773 , Create a new column like
New column = [Qty] * Switch( True(), [Name] = "partial" , 1, [Name] ="whole",4,1)
Hi @leroy773 ,
Try this column on Power Query:
if Text.Contains([Part Name], "partial") then 1 else 4 * [Qty]
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |