Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a column like so:
Cost Center |
CC0328: |
PG12312 |
PG12333 |
PG09862 |
PG12312 |
CC0223: |
PG23423 |
PG76732 |
PG92332 |
I'm looking to remove all the values that start with "PG" so that I am only left with values that start with "CC".
I've tried the following code but it's not working as expected:
= Table.ReplaceValue(#"Renamed Columns",
each "Cost Center",
each if Text.Start("PG") then "" else false,
Replacer.ReplaceText,{"Cost Center"})
How can I properly remove all values that start with "PG"?
Thank you.
Solved! Go to Solution.
Ah, OK. Add a new conditional column
= Table.AddColumn(#"Changed Type", "Custom", each if Text.StartsWith([Cost Center], "PG") then null else [Cost Center])
then you can delete the original column and rename the new one to Cost Center
Click the down arrow in the header of the column you want to filter and choose Text Filters -> Starts With, or Does not start with
That removes the entire row from the table when I'm in the data tab. I still need to keep the rows.
Ah, OK. Add a new conditional column
= Table.AddColumn(#"Changed Type", "Custom", each if Text.StartsWith([Cost Center], "PG") then null else [Cost Center])
then you can delete the original column and rename the new one to Cost Center
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
103 | |
77 | |
66 | |
63 |
User | Count |
---|---|
142 | |
105 | |
102 | |
81 | |
68 |