By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: Calculating a Dynamic Truncated Mean in Power BI Using DAX: A Quick Guide | HackerNoon
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > Computing > Calculating a Dynamic Truncated Mean in Power BI Using DAX: A Quick Guide | HackerNoon
Computing

Calculating a Dynamic Truncated Mean in Power BI Using DAX: A Quick Guide | HackerNoon

News Room
Last updated: 2026/01/10 at 8:15 PM
News Room Published 10 January 2026
Share
Calculating a Dynamic Truncated Mean in Power BI Using DAX: A Quick Guide | HackerNoon
SHARE

Why You Need a Truncated Mean

In data analysis, the standard AVERAGE function is a workhorse, but it has a significant weakness: it is highly susceptible to distortion from outliers. A single extreme value, whether high or low, can skew the entire result, misrepresenting the data’s true central tendency.

This is where the truncated mean becomes essential. It provides a more robust measure of the average by excluding a specified percentage of the smallest and largest values from the calculation.

While modern Power BI models have a built-in TRIMMEAN function, this function is often unavailable when using a Live Connection to an older Analysis Services (SSAS) model. This article provides a robust, manual DAX pattern that replicates this functionality and remains fully dynamic, responding to all slicers and filters in your report.

The DAX Solution for a Dynamic Truncated Mean

This measure calculates a 20% truncated mean by removing the bottom 10% and top 10% of values before averaging the remaining 80%.

You can paste this code directly into the “New Measure” formula bar.

Trimmed Mean (20%) =
VAR TargetTable="FactTable"
VAR TargetColumn = 'FactTable'[MeasureColumn]
VAR LowerPercentile = 0.10 // Defines the bottom 10% to trim
VAR UpperPercentile = 0.90 // Defines the top 10% to trim (1.0 - 0.10)

// 1. Find the value at the 10th percentile
VAR MinThreshold =
    PERCENTILEX.INC(
        FILTER(
            TargetTable,
            NOT( ISBLANK( TargetColumn ) )
        ),
        TargetColumn,
        LowerPercentile
    )

// 2. Find the value at the 90th percentile
VAR MaxThreshold =
    PERCENTILEX.INC(
        FILTER(
            TargetTable,
            NOT( ISBLANK( TargetColumn ) )
        ),
        TargetColumn,
        UpperPercentile
    )

// 3. Calculate the average, including only values between the thresholds
RETURN
CALCULATE(
    AVERAGEX(
        FILTER(
            TargetTable,
            TargetColumn >= MinThreshold &&
            TargetColumn <= MaxThreshold
        ),
        TargetColumn
    )
)

Deconstructing the DAX Logic

This formula works in three distinct steps, all of which execute within the current filter context (e.g., whatever slicers the user has selected).

  1. Define Key Variables
  • TargetTable & TargetColumn: We assign the table and column names to variables for clean, reusable code. You must change ‘FactTable'[MeasureColumn] to match your data model.
  • LowerPercentile / UpperPercentile: We define the boundaries. 0.10 and 0.90 mean we are trimming the bottom 10% and top 10%. To trim 5% from each end (a 10% total trim), you would use 0.05 and 0.95.

2. Find the Percentile Thresholds

  • MinThreshold & MaxThreshold: These variables store the actual values that correspond to our percentile boundaries.
  • PERCENTILEX.INC: We use this “iterator” function because it allows us to first FILTER the table.
  • `FILTER(…, NOT(ISBLANK(…))): This is a crucial step. We calculate the percentiles only for rows where our target column is not blank. This prevents BLANK() values from skewing the percentile calculation.
  • The result is that MinThreshold holds the value of the 10th percentile (e.g., 4.5) and MaxThreshold holds the value of the 90th percentile (e.g., 88.2) for the currently visible data.

3. Calculate the Final Average

  • RETURN CALCULATE(...): The CALCULATE function is the key to making the measure dynamic. It ensures the entire calculation respects the filters applied by any slicers or visuals in the report.
  • AVERAGEX(FILTER(...)): The core of the calculation. We use AVERAGEX to iterate over a table.
  • FILTER(...): We filter our TargetTable a final time. This filter is the “trim.” It keeps only the rows where the value in TargetColumn is:
  • Greater than or equal to our MinThreshold
  • AND
  • Less than or equal to our MaxThreshold
  • AVERAGEX(..., TargetColumn): AVERAGEX then calculates the simple average of TargetColumn for only the rows that passed the filter.

Conclusion

By implementing this DAX pattern, you create a robust, dynamic, and outlier-resistant KPI. This measure provides a more accurate picture of your data’s central tendency and will correctly re-calculate on the fly as users interact with your Power BI report.


Thank you for taking the time to explore data-related insights with me. I appreciate your engagement. If you find this information helpful, I invite you to follow me or connect with me on LinkedIn or X(@Luca_DataTeam). Happy exploring!👋

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article Your Google Pixel Could Be Hiding This Useful Feature – BGR Your Google Pixel Could Be Hiding This Useful Feature – BGR
Next Article 404 Accountability not found: Spyware accountability through software liability 404 Accountability not found: Spyware accountability through software liability
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

I Investigated Every Windows 12 Clue. These Are the Features I’m Betting Will Actually Arrive
I Investigated Every Windows 12 Clue. These Are the Features I’m Betting Will Actually Arrive
News
Tencent limits minors to 15 hours of gaming during 2025 winter break · TechNode
Tencent limits minors to 15 hours of gaming during 2025 winter break · TechNode
Computing
Best power station deal: Save ,300 on Jackery Explorer 2000 v2
Best power station deal: Save $1,300 on Jackery Explorer 2000 v2
News
Apple secures seven nominations for 37th Producers Guild Awards
Apple secures seven nominations for 37th Producers Guild Awards
News

You Might also Like

Tencent limits minors to 15 hours of gaming during 2025 winter break · TechNode
Computing

Tencent limits minors to 15 hours of gaming during 2025 winter break · TechNode

1 Min Read
Tesla China abruptly launches redesigned Model Y at higher price · TechNode
Computing

Tesla China abruptly launches redesigned Model Y at higher price · TechNode

1 Min Read
Week in Review: Most popular stories on GeekWire for the week of Jan. 4, 2026
Computing

Week in Review: Most popular stories on GeekWire for the week of Jan. 4, 2026

4 Min Read
First NIO-partnered EV with swappable batteries to go on sale in Q3: report · TechNode
Computing

First NIO-partnered EV with swappable batteries to go on sale in Q3: report · TechNode

1 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?