Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
DPCCGF
Helper IV
Helper IV

Split Columns

I need to split a column with a delimiter of "-".  However, this column does not always have an equal amount of, what I will call, splits.  Plus, I have a Project Name that sometimes has the delimiter in the name.  So if this column has splits that are 5, 6, 7 sections how does one split this and ensure each column as the appropriate data for that column?  Hope I am making sense.

1 ACCEPTED SOLUTION

hi @hnguy71 ,

 

Could you describe how should the result look like?

View solution in original post

8 REPLIES 8
DPCCGF
Helper IV
Helper IV

Well each split should have the same info in the split column.  So if Department is in column 6 of the first project it should fall into column 6 for all projects.  But it does not always follow what you would expect.  The split itself works fine, it is just that some projects split into 6 rows and some up to 10 rows.  And the bad part is row 4, let's say, does not always contain the same type of data, say Project Start Date.  Some projects have a "blank" when there is no data but others do not.  Hope that makes sense. 

Hi @DPCCGF ,

That's understood but without sample data and expected results I can't help you.


Sample input:

Column
A-B-C
1-b-2-3
D-E-F-4-g

 

Sample outout:

Column1Column2Column3Column4
ABColumn3 
1b23
D-EF4G

 

Also if you have business logic as to what should go where it would make support process faster.



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Here you go!

Project IDColumn to Split
28311512068 - XXXXXXX - - TAX - Individual Tax - 104022 - 2022 1040 Individual Tax Return - YYYYYYY
28311611721 - XXXXXXXX - 12/2022 - TAX - Business Tax - 106522 - 2022 1065 Partnership Return
28311711721 - XXXXXXXXX - 12/2022 - TAX - Business Tax - 112022 - 2022 1120 Corporation Return
28311811721 - XXXXXXXX - 12/2022 - AA: Audit - For Profit - BASICAUDFP22 - 2022 Basic Audit (FP)
28311911696 - XXXXXXXX. - 12/2018 - OAFC - Monthly - 107627 - Monthly Accounting
28312011696 - XXXXXXX. - 12/2022 - OAFC - Compliance - 990Prep2022 - 2022 990 Preparation
28312111779 - XXXXXXXXXXXXX - 12/2023 - AA:Non Attest - 990 NFP Tax Return - 2023 990 Tax Form
28312227503 - XXXXXXXXXXXXXXXXXXXX. - 12/2023 - AA:Non Attest - 990 NFP Tax Return - 2023 990 Tax Form
28312367140 - XXXXXXXXXXXXXXXXXXXXXXXXXXXX - 6/2022 - AA:Non Attest - 125967 - 2022 990 Tax Return
28312421456 - XXXXXXXXXXXXXXXXXXX. - 12/2022 - AA: Audit - NFP - BASICAUDNFP22 - 2022 Basic Audit (NFP)
28312553024 - yyyyyyyyyyyyyyyyyyyC. - 12/2022 - AA: Audit - NFP - BASICAUDNFP22 - 2022 Basic Audit (NFP)
28312612388 - LHHHHHHHHHHHHHH - - TAX - Fiduciary Tax - 104122 - 2022 1041 Estate and Trust Return
28312712821 - HHHHHHHHHHHHHHHHHH. - 12/2023 - AA: Consulting - NON ATTEST CONSULTIN - OTHER NON ATTEST
28312812560 - HHHHHHHHHHHHHHHHHHHHHHH - 12/2022 - AA: Audit - NFP - CS_58688 - 2022 Basic Audit (NFP) | 2022 NON PROFIT AUDIT
28312917352 - KKKKKKKKKKKKKKKKKKKKKKKKK - 12/2022 - AA: Consulting - LeaseAcctg - Lease Accounting
28313011941 - KKKKKKKKKKKKKKKKKKKKKKKKKKKKK. - 12/2022 - AA: Compilation - COMP22 - 2022 Compilation
28313137403 - KKKKKKKKKKKKKKKKKKKKKKK- 12/2022 - AA: Audit - NFP - BASICAUDNFP22 - 2022 Basic Audit (NFP)
28313237403 - AAAAAAAAAAAAAAAAAAAAAAA - 12/2021 - AA:Non Attest - 125311 - 2021 990 Tax Return
28313337403 - AAAAAAAAAAAAAAAAAAAAAAAAA - 12/2017 - AA: Consulting - 98436 - OTHER NON ATTEST
28313451107 - EEEEEEEEEEEEEEEEEEEEEEC. - 12/2022 - AA: Audit - NFP - CS_58791 - 2022 UG Audit | 2022 Non Profit Audit
28313551107 - CCCCCCCCCCCCCCCCCC. - 6/2022 - AA: Audit - NFP - 58792 - 2022 UNIFORM FINANCIAL REPORT
28313651107 - CCCCCCCCCCCCCCCCCCCCCCNC. - 12/2022 - AA: Consulting - LeaseAcctg - Lease Accounting
28313712613 - GGGGGGGGGGGGGGG- - TAX - Consulting - COVID CONSULTING [TT - 2022 COVID CONSULTING
28313874065 - GGGGGGGGGGGGGGGGGGGGGG - 6/2022 - AA:Non Attest - 122786 - 2021 990 Tax Return

Okay, now what's your expected output?

 

I'm not sure I understand the issue now that I'm seeing your sample input.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("rZZdb5swFIb/ipWrTWo7bIOB3Tk0tGgpoIRMm6JqQglbkVKI+JhWqT9+x0BiE0g6TT034A/54Ry/fs16PSEWxdiYXE0w0ZiFrtG3NuDtGkVcPL1sm/5Ot3W8Q1H8BzqwpmuEwAsRD9E6nbNIqrrIYMb3NiaPVx2KCRQ2CZYowcDkE2nXbJnTukyzpCyPRGaoRGagMC6qLCnKp3Tf4STEHIH8CwUTNS9oIScv9nkRV2meDSjWW6lw/hnxeptW8O7mBQqL/GfTmPKl5/DVrRtK3DQu0003/YMbfpQcu+EwmymcmwMIiz0LuOvA4yHPqqfdS1MvkxFT6eKbTV5nVZr9Oq5LtOG6N73v75Z18uf9Lo2zTQIN29bCItmrhYIuJPritk4SgNsCmba6Db0q0bZKPlSXV1VSVi0B+W7Y11EzV4yIXqjls6QQoBDT0OgpZZDTe9Ao0JiJQfLjNCVFpuigx8TEsJmplk/SJUkXeWHdYOOk/lapUhPpSI35Z0XmqyojwgMMqhEd5r4Mw3lvXmMEhFpCv/P7Xije44KnbNK4eJHWg3vWg9GsrOIqQXG2RVFRQ4FPC9m4AbGac3o/iIE8QO9ZWe/EWRHJBT7iUTRbRsgJ/OVqHnm+OBrR/WyhDEpa4wrEYNoo7ZDfpUo6yx+GxZrCjBcRvbYDAh8uAteLEBTeUz6isQyTGgLw5VwMPqOX+DyJywRsozo2xkyEtiZi6/gSScRQP8JX0l3rrZB18KAIRxmTLOEn1NSbk36G8q4apUQB8vE4ZoXHDzr4dwvC5w46pW9TJAebY5tlWzpll2RJhZsYGO4FmDUbjTdPeKNL08aHwq3uugkHOULq3RXX9Eu4ocCdQdyceOUJVjCPm7XyPTdYPCDX87nveHyOFrMwWCiJsossEf5Ipv8j/dZXGBb7dtcPaWC9hZ3gq3crfeQOraPoqPiTMckRjgLygH+eAaeLy5cNMS12ToOPfwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Project ID" = _t, #"Column to Split" = _t]),
    #"Split Column by Delimiter" = Table.SplitColumn(Source, "Column to Split", Splitter.SplitTextByDelimiter("-", QuoteStyle.Csv), {"Some Id", "Some String", "Date It Seems", "Category", "Sub Category", "Sub Sub Category", "Note It Seems"})
in
    #"Split Column by Delimiter"


Split by Delimiter result:

hnguy71_0-1730767625440.png


What's your condition for where? Can you supply a sample output?



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
hnguy71
Super User
Super User

Hi @DPCCGF ,

Do you have sample data that you can share? Seems like you want some conditional split. It is possible but without any reference it would be hard to assist.



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
FreemanZ
Super User
Super User

hi @DPCCGF ,

 

try to split the column by each occurence of delimiter into rows. 

IMG_20241103_223611.jpg

 

check more here:

https://learn.microsoft.com/en-us/power-query/split-columns-delimiter

 

This worked but I now have project ids (which is the key) with 5 rows, 6 rows or 7 rows.  This is because the split column does not always have the same number of splits.  Hope I am making sense. I actually did a count of rows on the project Id and it ranges from 6-10

hi @hnguy71 ,

 

Could you describe how should the result look like?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors