Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi all,
I need your guidance on how to split/extract a column by character transition if a condition is true.
I have a table with two columns:
Hostname | Username |
Machine01 | Username01 |
Machine02 | Username02 |
Cloud Machine | v12345 |
Cloud Machine | v67890 |
Machine03 | Username03 |
Cloud Machine | v91735 |
My condition must be: IF [Hostname] = "Cloud Machine" THEN split username from non-digit to digit ELSE [Username]
Therefore, my new column must be:
Hostname | New Username |
Machine01 | Username01 |
Machine02 | Username02 |
Cloud Machine | 12345 |
Cloud Machine | 67890 |
Machine03 | Username03 |
Cloud Machine | 91735 |
Any ideas on how to do this either in DAX or PowerQuery?
Solved! Go to Solution.
Hi,
try this in a new column in power query:
if [Hostname] = "Cloud Machine" then Text.Remove(
[Username],
{
Character.FromNumber(32)..Character.FromNumber(47),
Character.FromNumber(58)..Character.FromNumber(255)
}
)
else [Username]
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Hi,
try this in a new column in power query:
if [Hostname] = "Cloud Machine" then Text.Remove(
[Username],
{
Character.FromNumber(32)..Character.FromNumber(47),
Character.FromNumber(58)..Character.FromNumber(255)
}
)
else [Username]
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
No problem, happy to help 🙂
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |