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 have in Visual Studio a table `Y2_Sales` which contains a column "`color`" with values like this :
85-GREY MARLE
90-BLACK
90-BLACK
1000-WHITE
49-NAVY
90-BLACK
3021-BONE
I would like to make a calculated column in my template and delete everything after the dash and put the remaining numbers on 4 characters, which would give :
0085
0090
0090
1000
0049
0090
3021
I tried this formula but it returns me for example `90-` how to remove this last dash?
=LEFT([color],
IF (SEARCH("-",[color],1,0) > 0,
SEARCH("-",[color],1,0),
LEN([color])
)
)
Could someone help me?
Hi, @matdub40
I am not sure if you want to do this in Power Query Editor.
I think it is a bit easier doing this in Power Query Editor like below (link down below)
https://www.dropbox.com/s/oxp7d0nks97tort/matdub.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi @Jihwan_Kim ,
Thank you for your answer, I will look into it, but I would prefer to do it in Visual Studio with a calculated column without having to modify the Power BI part.
You have made two distinct columns that separate my two values, I have only one column your two columns separated by a dash like: 90-BLACK
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 |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
44 | |
32 | |
30 | |
18 | |
17 |