Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a combined field that has area, unit, and supervisor. I can split it in power query but it gets messy as some fields only have a unit name. I'm looking for IF( SEARCH("-") THEN SPLIT, else "unit" but that ignores the second hyphen. Also I do not think SPLIT is a DAX function.
column value: "area - unit - supervisor"
I want to generate seperate columns for area, unit, and supervisor.
Is there a dax function for splitting columns based on deliminators? It's a basic function in Tableau but trying to translate it into Power BI Dax
Hi @BW40 ,
Based on your description, I made simple samples and you can check the results as follows:
DAX expression:
Area = VAR _CONTAIN = CONTAINSSTRING(MAX('Table'[Text]),"-")
VAR _PATHITEM = SUBSTITUTE(MAX('Table'[Text]),"-","|")
RETURN
IF(_CONTAIN,PATHITEM(_PATHITEM,1),"")
Unit = VAR _CONTAIN = CONTAINSSTRING(MAX('Table'[Text]),"-")
VAR _PATHITEM = SUBSTITUTE(MAX('Table'[Text]),"-","|")
RETURN
IF(_CONTAIN,PATHITEM(_PATHITEM,2),MAX('Table'[Text]))
Supervisor = VAR _CONTAIN = CONTAINSSTRING(MAX('Table'[Text]),"-")
VAR _PATHITEM = SUBSTITUTE(MAX('Table'[Text]),"-","|")
RETURN
IF(_CONTAIN,PATHITEM(_PATHITEM,3),"")
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
in power query you can right click on a column and split by delimiter and other options. It is also better from a performance perspective to create calculated columns in power query.
if you need more help than that, i think you will need to provide a sample of your data (in text form) - it is quite difficult to provide a accurate solution without knowing what the data looks like.
Proud to be a Super User!
I found the simplest solution was to create two split by deliminiter functions in query. That allowed me to break up the fields but it would not allow me to create an IF condition. I had to create groups and do other manual clean up actions to get the data to an approximation of what is needed. It isn't exact but it is functional.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
63 | |
62 | |
52 | |
39 | |
24 |
User | Count |
---|---|
85 | |
57 | |
45 | |
43 | |
38 |