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, i have a bunch of strings (serial numbers) and i want to categorize them accordingly with a new calculated column
The lenght is important to me, only if the serial starts with AA.
Really hope you can help
Input | Desired output |
AA12345678910 | AA-long |
AA1234 | AA-Short |
AA12345678911 | AA-Long |
AA1235 | AA-Short |
BB123212 |
Solved! Go to Solution.
Hi @FrederikAhring ,
You can create a calculated column as below to get it:
Desired output =
IF (
LEFT ( 'Table'[Input], 2 ) = "AA",
IF ( LEN ( 'Table'[Input] ) <= 6, "AA-Short", "AA-Long" ),
BLANK ()
)
Best Regards
Hi @FrederikAhring ,
You can create a calculated column as below to get it:
Desired output =
IF (
LEFT ( 'Table'[Input], 2 ) = "AA",
IF ( LEN ( 'Table'[Input] ) <= 6, "AA-Short", "AA-Long" ),
BLANK ()
)
Best Regards
Try this custom column in Power Query:
if Text.Start([Input], 2) = "AA" then
if Text.Length(Text.Middle([Input], 3, Text.Length([Input]))) > 4 then
"AA-Long"
else
"AA-Short"
else
null
Proud to be a Super User!
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 |
---|---|
105 | |
96 | |
79 | |
67 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |