Forum Discussion
How to remove one semicolumn using DAX coding?
- 1 year ago
Thank you for the emessage!
I have manually modified the source file using programming Editor.
Hi toplisek,
Thank you for the clarification and you're right. Since DAX is designed for calculations after the data has been loaded into the model, it's not suitable for cleaning raw CSV files. Power Query (M) is indeed the right place to handle that kind of data transformation before it enters your model.
Instead of continuing to manually edit the raw files outside of Power BI, you can automate the process within Power Query. This way, the cleaning steps will consistently apply every time you refresh the data no more manual intervention needed.
For example, if your raw file has invalid values like Age = 0 or extreme outliers (e.g., Age > 120), you can use this simple Power Query snippet to correct them:
M Code:
= Table.TransformColumns(Source, {
{"Age", each if _ = 0 or _ > 120 then null else _, Int64.Type}
})
This replaces invalid age entries with null, which you can later treat or exclude in your visuals.
If you're dealing with specific types of errors or patterns, feel free to share an example I'd be happy to provide a customized M script to match your scenario.
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
Hi toplisek,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
- v-kpoloju-msft1 year agoCommunity Support
Hi toplisek,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.- v-kpoloju-msft1 year agoCommunity Support
Hi toplisek,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.