The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
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
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
32 | |
13 | |
10 | |
10 | |
9 |