Forum Discussion
Dax Code to identify Outliers
Long time reader, first time poster...
I'm having a difficult time figuring out the DAX formula to identify outliers. I can easily do this in Excel but just can't figure out the needed DAX code. Long story short, I'm trying to identify outliers based on where the Minutes column is greater than the Upper Bound for that given Code(Code column). (E.G. Code 101 is only looking for it's Minutes that are greater than it's Upper Bound). FYI...I'm using the IQR method to identify outliers. Below is a mock up in excel:
Can anyone help me solve this one?
4 Replies
- tamerj1
Community Champion
Hi finance_124
you can create new column
IF ( Table[Minutes] > Table[Upper Bound], "Outlier", "Normal" )
- finance_124New Member
Thanks tamerj1. I thought it was as easy as that but it's showing them all as normal.
FYI..I've inherited this existing Power BI dashboard and they want some enhancements to it.Now, would it be because a measure was created for Avg, 25th Percentile, 75th Percentile, IQR, Lower Bound, and UpperBound versus creating a new column for those? There are also some filters that the user could apply on the front page(Account and Date), I've included those two fields to show what they could filter on. Is there a way to do an outlier formula in a measure?
Please note: All yellow columns are Measures.
- Whitewater100
Solution Sage
Hello:
You can try a calculated column in your table.
Outlier = IF(Table[Minutes] > Table[Upperbound], "Outlier", "Normal")
I hope this works out for you.
- tamerj1
Community Champion
Sorry I thought this is a source data table. However, it should also work if you create a measure the same way.
IF ( SUM ( Table[Minutes] ) > [Upper Bound], "Outlier", "Normal" )