Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
procyon82
Resolver I
Resolver I

Removing Outliers

Is there an easy way to remove any outliers in Power BI desktop?

I am currently importing revenue from Google Analytics, but every now and then we get very large purchases that scew the averages. Could I simply apply a filter and say "avg. revenue only on the values that are under $5000"? Or maybe use a standard deviation function that we'll do this automatically for me?

2 ACCEPTED SOLUTIONS
jahida
Impactful Individual
Impactful Individual

That reads as: In some context (CALCULATE), is the SUM > 5000?

 

I think you want:

 

Revenue Month  = CALCULATE(SUM('GA Ecommerce'[Revenue]), 'GA Ecommerce[Revenue] < 5000,PARALLELPERIOD('GA Ecommerce'[Date],0,MONTH))

View solution in original post

Hi @procyon82,

 

Now what you need is removing outliers at daily level instead of individual transactions level, right?

 

If that is the case, you can add a new table to sum up the revenue at daily level by using SUMMRIZE function. I have tested it on my local environment, here is the sample expression for you reference.

DailyRevene = SUMMARIZE(Daily,Daily[Date],"Daily total",SUM(Daily[Sales]))

Capture.PNGCapture1.PNG

 

Then you can remove the outliers on daily level in this new created table.

 

Regards,

Charlie Liao

View solution in original post

8 REPLIES 8
Greg_Deckler
Super User
Super User

In the Query Editor, make sure that the column is numeric and then click on the drop down arrow in the column header and choose "Number Filters" and there you have a choice of:

 

Equals

Does not equal

Greater than

Greater than or equal to

Less than

Less than or equal to

Between


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I guess the only downside with this is that it filters the entire query and all the columns/measures that I have. Is there a way to only apply it to a column or measure?

Yes, for that you would use a CALCULATE function (DAX). Basically:

 

CALCULATE(SUM([Some Column]),[Some Column] < 500000)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Any idea why the response in a table is "True" or "False" instead of a number?

 

I'm using: 

Revenue Month  = CALCULATE(SUM('GA Ecommerce'[Revenue]) < 5000,PARALLELPERIOD('GA Ecommerce'[Date],0,MONTH))

 

jahida
Impactful Individual
Impactful Individual

That reads as: In some context (CALCULATE), is the SUM > 5000?

 

I think you want:

 

Revenue Month  = CALCULATE(SUM('GA Ecommerce'[Revenue]), 'GA Ecommerce[Revenue] < 5000,PARALLELPERIOD('GA Ecommerce'[Date],0,MONTH))

 

Got it to work. I am not sure what I was doing wrong earlier, but I started from scratch.

The only issue right now is that it's looking at daily revenue and not individual transactions, so I just gotta figure that out.

Hi @procyon82,

 

Now what you need is removing outliers at daily level instead of individual transactions level, right?

 

If that is the case, you can add a new table to sum up the revenue at daily level by using SUMMRIZE function. I have tested it on my local environment, here is the sample expression for you reference.

DailyRevene = SUMMARIZE(Daily,Daily[Date],"Daily total",SUM(Daily[Sales]))

Capture.PNGCapture1.PNG

 

Then you can remove the outliers on daily level in this new created table.

 

Regards,

Charlie Liao

No, I wasn't looking for outliers by looking at daily totals. I was looking for individual transactions that would skew my averages.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.