Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all!
I created a column chart displaying customers' sales and added 2 reference lines- average ($5.63 M) and 80th percentile line ($7.91 M).
Now, I wish to calculate the same percentile value using DAX, I'm getting $731.62M!
Could you please guide me on how I can get the same results using DAX??
One issue with your measure is that SUM ( Sales[Gross Sales] ) needs to be wrapped in CALCULATE (or define a measure and reference that measure instead).
Also, to replicate the behaviour of the percentile line, we have to use ALLSELECTED and remove blanks to ensure the Customers included in the visual are included.
Something like:
Sales Over 80Percentile =
VAR CustomerSales =
FILTER (
ADDCOLUMNS (
ALLSELECTED ( Customers[Customer_ID] ),
"@Sales", CALCULATE ( SUM ( Sales[Gross Sales] ) )
),
NOT ISBLANK ( [@Sales] )
)
RETURN
PERCENTILEX.INC ( CustomerSales, [@Sales], 0.8 )
Does this work for you?
Regards
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
10 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
13 | |
12 | |
11 | |
8 |