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.
I would like to create some criteria when extracting the text based on the number of "-" and the text of the column starting with "ABLE TO PLAY".
If the column starts with the text "ABLE TO PLAY" and the amount of ; "-" is greater than 1 so I want it to extract the text following this RULE:
Text.BetweenDelimiters([SPENDING LOCATION], "-", "-", 0, 1)
But if the number of "-" is less than or equal to 1 then I want it to use:
Text.AfterDelimiter([SPENDING LOCATION], " ", 2).
If the column starts with any text other than "ABLE TO PLAY" it can return the normal value of the column without change.
Solved! Go to Solution.
= Table.AddColumn(#"Renamed Columns", "Custom",
each if
Text.Length(Text.Select([_5],"-"))>1 and Text.StartsWith([_5],"ABLE TO PLAY")
then Text.BetweenDelimiters([_5], "-", "-", 0, 1)
else if
Text.Length(Text.Select([_5],"-"))<=1 and Text.StartsWith([_5], "ABLE TO PLAY")
then Text.AfterDelimiter([_5], " ", 2) else [_5])
Achieve after testing a lot! If anyone has the same problem or something similar I hope it helps.
= Table.AddColumn(#"Renamed Columns", "Custom",
each if
Text.Length(Text.Select([_5],"-"))>1 and Text.StartsWith([_5],"ABLE TO PLAY")
then Text.BetweenDelimiters([_5], "-", "-", 0, 1)
else if
Text.Length(Text.Select([_5],"-"))<=1 and Text.StartsWith([_5], "ABLE TO PLAY")
then Text.AfterDelimiter([_5], " ", 2) else [_5])
Achieve after testing a lot! If anyone has the same problem or something similar I hope it helps.
Hi,
Will you able to share some sample records?
Thanks
Hari
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 |
---|---|
18 | |
15 | |
11 | |
11 | |
8 |
User | Count |
---|---|
24 | |
18 | |
12 | |
11 | |
10 |