Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi.
I am new to DAX and was hoping there was a way to do this:
I have a column with poor data quality, meaning there are a lot of variations that may be present with the word High in them. I do not have a comprehensive list of what these could be. Few examples, High Impact, Moderate-High, Mod-High, HIGH, High, etc. Is there any way to say if this string contains High (anywhere case insensitive then replace the value in that field with High?
I know Find & Replace and Substitute but those you have to know what derivations there could be.
Thanks in Advance.
Solved! Go to Solution.
although when you load data into power bi it will be as you want because power bi is not case sensitive
but all of these can be done in power query the way you want
pls try this
@Ahmedx @PijushRoy Hi Guys, worked around and got the solution.
Table.ReplaceValue(#"Change Value", each [Rating], each if Text.Contains([Rating],"High",Comparer.OrdinalIgnoreCase) then "High" else [Rating], Replacer.ReplaceValue, {"Rating"})
In the Applied Steps, I did an insert step after and put the formula there. It used the same column, Rating, as my original values and left null/blank as null/blank and other values without the word High in them alone. All derivations of High in the data set were handled (still need to test the Mod-High) but so far that worked. Just wanted to share since both of your help gave me a big boost in noodling out a solution.
Hi Ahmed, I closed the solution prematurely. I tested it as the column has other values and it is converting all of them to High when it shouldn't. Any thoughts? There are many values in the column and there is no set defined list of values hence the request for something to look and only convert the ones with High, leave null/blank and ones without High in them as is.
I think that might work; however, as written it makes all nulls = High. So I changed x <> to x= that doesn't happen. Need to test some other values in data that is not present now (like low, medium) to ensure all works properly. Thank you so much!
Thanks for pasting the image as I am locked down from downloads. I will give it a go.
Hi @Krc721
Please use CONTAINSSTRING dax function in calculated column
Find example - https://learn.microsoft.com/en-us/dax/containsstring-function-dax
https://dax.guide/containsstring/
https://www.sqlbi.com/tv/containsstring-containsstringexact-dax-guide/
Let me know if that works for you
If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.
Thanks
Pijush
Linkedin
Proud to be a Super User! | |
Thank you for your response. That creates a new column with numeric value but does not replace the words in the existing column to standardize on one word, High, that will be used in logic. I don't know all the variations that could exist in the data so wouldn't this potentially leave some records out?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
74 | |
73 | |
56 | |
38 | |
31 |
User | Count |
---|---|
83 | |
64 | |
63 | |
49 | |
45 |