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
Anonymous
Not applicable

Apply AVERAGE for column skipping first 5% and last 5% values

I have a direct query from Power BI Desktop to SQL Server. The table will be updated every day increasing the row number. 

Below an example of raw data:

Original Raw DataOriginal Raw Data

Now I need to measure the AVERAGE skipping the first 5% of row count and last 5% of row count (20 rows in this example * 5 divided by 100).

Rows = CALCULATE(
DISTINCTCOUNT(
'tableBus'[ID]
) * 5 / 100
)
So, this DAX give ne the number of rows that I need to skip in the beginning and in the end of table, in this example 1 line due the total count rows equal 20. Besides skip the first 5% and last 5% of lines, I need to sort the column values to calculate the AVERAGE:
Expected ResultExpected Result

In this example the average (in seconds) is 853, between value 3 and value 2447. Do you have any idea how I can get this in DAX using a Calculated Measure?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

3 REPLIES 3
kentyler
Solution Sage
Solution Sage

Why do you need to sort the columns to calculate the average ? won't it be the same no matter what the order ?





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Anonymous
Not applicable

This is a business rule, if I skip only the first 5% and last 5% I can calculate an outlier in the AVERAGE. Because of this, I need to follow this requirement to remove first 5% of min values and last 5% of max values.

Anonymous
Not applicable

I found a solution in this link: https://xxlbi.com/blog/trimmean-dax/  

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.

Top Solution Authors