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.
hi all
I have a list of customer id from the system which is not accurate, is it possible to achieve the following with power bi as a new column? Any advice is appreciated.
Thank you so much!
Solved! Go to Solution.
Try the following formula:
New Column =
SWITCH( TRUE(),
LEFT(Table[CustomerID],1) = "w" , Table[CustomerID],
LEFT(Table[CustomerID],3) = "000" , "u" & Table[CustomerID],
LEN(Table[CustomerID]) = 3 , "z" & Table[CustomerID],
"Other"
)
1. Create a new column for Result field
2. Create an another column for font formatting.
Try the following formula:
New Column =
SWITCH( TRUE(),
LEFT(Table[CustomerID],1) = "w" , Table[CustomerID],
LEFT(Table[CustomerID],3) = "000" , "u" & Table[CustomerID],
LEN(Table[CustomerID]) = 3 , "z" & Table[CustomerID],
"Other"
)
how shoulld the formula be to "a" to replace 000 i tried replace but it doesnt work?
Replace = (Table[CustomerID],1,3,"a"),
could you advice me again?
Hi @kokoro_1202
This might help your requirement
The formula should be
Column = REPLACE(Table[CustomerID],1,3,"a")
Tried the following, but it say "Function 'SWITCH' does not support comparing values of type True/False with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values."
New Column =
SWITCH( TRUE(),
LEFT(Table[CustomerID],1) = "w" , Table[CustomerID],
REPLACE(Table[CustomerID],1,3,"a"),
LEN(Table[CustomerID]) = 3 , "z" & Table[CustomerID],
"Other"
)
Try this:
New Column =
SWITCH( TRUE(),
LEFT(Table[CustomerID],1) = "w" , Table[CustomerID],
LEFT(Table[CustomerID],3) = "000" , REPLACE(Table[CustomerID],1,3,"a"),
LEN(Table[CustomerID]) = 3 , "z" & Table[CustomerID],
"Other"
)
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 |
---|---|
110 | |
97 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |