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.
I want to create a column from another column. The column has Numerical values and Text Values hence can only be stored in text values. The column is as follows and the column next to it is my ask.
Item Code | Desired Column | |
100000 | Item | |
100001 | Item | |
100002 | Item | |
100003 | Item | |
100004 | Item | |
100005 | Item | |
6000000 | Parts | |
6000001 | Parts | |
6000002 | Parts | |
6000003 | Parts | |
6000004 | Parts | |
LABOUR | Labour | |
LABOUR | Labour |
The items range is 100000 to 100117 and the Parts range is 6000000 to 6000234. LABOUR is just Labour.
Solved! Go to Solution.
Hi @Datagulf ,
You can try this method:
New a column:
Desired Column =
IF (
MID ( 'Table'[Item Code ], 1, 3 ) = "100",
"Item",
IF ( MID ( 'Table'[Item Code ], 1, 3 ) = "600", "Parts", "Labour" )
)
The result is:
Hope this helps you.
Here is my PBIX file.
Best Regards,
Community Support Team _Yinliw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Datagulf ,
add a conditional column using this code
#"Added Conditional Column" = Table.AddColumn(#"Removed Top Rows", "Custom", each if Text.StartsWith([#"Item Code "], "1") then "Item" else if Text.StartsWith([#"Item Code "], "6") then "Parts" else "Labour")
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Datagulf ,
You can try this method:
New a column:
Desired Column =
IF (
MID ( 'Table'[Item Code ], 1, 3 ) = "100",
"Item",
IF ( MID ( 'Table'[Item Code ], 1, 3 ) = "600", "Parts", "Labour" )
)
The result is:
Hope this helps you.
Here is my PBIX file.
Best Regards,
Community Support Team _Yinliw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 | |
100 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |