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 the below step code:
= if List.AnyTrue(List.Transform(#"Capitalized Each Word"[Delivery status], each Text.Contains(_, "/"))) then Table.SplitColumn(#"Capitalized Each Word", "Delivery status", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), {"Status", "Count"}) else #"Capitalized Each Word"
What I am trying to do is to split column: Delivery status into columns: Status and Count, by delimeter " ", only if column: Delivery status contains "/", otherwise, do not proceed with the split.
It executes perfectly when if is TRUE, but it does not execute correctly when if is FALSE, it should not split, but it splits anyways.
What do I need to modify here?
Solved! Go to Solution.
Hi, @MagdoulinShams1
Thanks for the reply form Ashish_Mathur and audreygerred. You can try to use the Split Column function directly.
= Table.SplitColumn(#"Changed Type", "Delivery status", Splitter.SplitTextByDelimiter("/", QuoteStyle.Csv), {"Status", "Count"})
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi, @MagdoulinShams1
Thanks for the reply form Ashish_Mathur and audreygerred. You can try to use the Split Column function directly.
= Table.SplitColumn(#"Changed Type", "Delivery status", Splitter.SplitTextByDelimiter("/", QuoteStyle.Csv), {"Status", "Count"})
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi,
Could you share some data to work with and show the expected result.
Hi! It's ok - let the split happen on everything. Then, add a conditional column and do something similar to the below. You would say that if one column contains a /, return the value in column A, if it does not, return column B.
Proud to be a Super User! | |
I hoped to reach the desired outcome in one step, but this is a good suggestion too.