Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have a dataset that includes members' ages. The age column has outlier values such as 0 and 145. Before creating the data model and visuals, I want to detect outliers in Power Query and use quantile based flooring and capping method to treat and replace them. I appreciate your help in advance.
Solved! Go to Solution.
Check if this post can help you achieve what you need.
https://www.linkedin.com/pulse/power-bi-briefing-mpower-query-outlier-detection-time-chatterjee/
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @MarjanZamani,
Thank you for reaching out to the Microsoft fabric community forum. Also thanks to @MFelix , for his insights on this thread. I reproduced the scenario, and it worked on my end. I used M code and successfully implemented it. Used line chart.
Open a blank query; it should appear like this. Then, copy and paste the M code into the advanced editor:
M Code:
let
Source = Table.FromRows({
{1, 25},
{2, 32},
{3, 0},
{4, 28},
{5, 35},
{6, 40},
{7, 145},
{8, 22},
{9, 90},
{10, 18},
{11, 55},
{12, 60},
{13, 75},
{14, 20},
{15, 33}
}, {"MemberID", "Age"}),
AddFinal = Table.AddColumn(Source, "Final_Age", each
if [Age] < 20 then 20
else if [Age] > 75 then 75
else [Age])
in
AddFinal
outcome:
I am also including .pbix file for your better understanding, please have a look into it:
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 @MarjanZamani,
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.
Hi @MarjanZamani,
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.
Hi @MarjanZamani,
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.
Thank you.
Hi @MarjanZamani,
Thank you for reaching out to the Microsoft fabric community forum. Also thanks to @MFelix , for his insights on this thread. I reproduced the scenario, and it worked on my end. I used M code and successfully implemented it. Used line chart.
Open a blank query; it should appear like this. Then, copy and paste the M code into the advanced editor:
M Code:
let
Source = Table.FromRows({
{1, 25},
{2, 32},
{3, 0},
{4, 28},
{5, 35},
{6, 40},
{7, 145},
{8, 22},
{9, 90},
{10, 18},
{11, 55},
{12, 60},
{13, 75},
{14, 20},
{15, 33}
}, {"MemberID", "Age"}),
AddFinal = Table.AddColumn(Source, "Final_Age", each
if [Age] < 20 then 20
else if [Age] > 75 then 75
else [Age])
in
AddFinal
outcome:
I am also including .pbix file for your better understanding, please have a look into it:
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 @MarjanZamani,
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.
Hi @MarjanZamani,
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.
Hi @MarjanZamani,
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.
Thank you.
Check if this post can help you achieve what you need.
https://www.linkedin.com/pulse/power-bi-briefing-mpower-query-outlier-detection-time-chatterjee/
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português