Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi guys, I am trying to calculate the sales of my customers who are greater than the 95th percentile of all customers within each segment. The total is correct, but I want the measure to calculate the unique/distinct customers who attribute towards that top percentile sales volume. As you can see, each customer has a blank value despite the total being accurate. Any ideas of how I can tweak my measures?
Essentially I want the measure to calculate only the customers sales figures from Hill Supplies to Mr. Rooter.
Solved! Go to Solution.
@cdawidow
You can follow the measure given below, I did it with my sample data and you can adopt it.
Cutomers 95 Pcntl =
var __p = PERCENTILEX.INC( ALLSELECTED('Customer Table'[customore name]),[Total Sales], .95 ) return
SUMX(
FILTER(
VALUES('Customer Table'[customore name]),
[Total Sales] >= __p
),
[Total Sales]
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@cdawidow
Please try this:
Cutomers 95 Pcntl =
var __cust = FILTER( ALLSELECTED('Customer Table'[customore name]), [Total Sales] > 0 )
var __p = PERCENTILEX.INC( __cust,[Total Sales], .95 ) return
SUMX(
FILTER(
VALUES('Customer Table'[customore name]),
[Total Sales] >= __p
),
[Total Sales]
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@cdawidow
You can follow the measure given below, I did it with my sample data and you can adopt it.
Cutomers 95 Pcntl =
var __p = PERCENTILEX.INC( ALLSELECTED('Customer Table'[customore name]),[Total Sales], .95 ) return
SUMX(
FILTER(
VALUES('Customer Table'[customore name]),
[Total Sales] >= __p
),
[Total Sales]
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thank you ! This works perfectly! I was wondering, I want to exclude all negative sale values so anything over $0 would be excluded. How can I add the filter to the percentile calculation ?
@cdawidow
Please try this:
Cutomers 95 Pcntl =
var __cust = FILTER( ALLSELECTED('Customer Table'[customore name]), [Total Sales] > 0 )
var __p = PERCENTILEX.INC( __cust,[Total Sales], .95 ) return
SUMX(
FILTER(
VALUES('Customer Table'[customore name]),
[Total Sales] >= __p
),
[Total Sales]
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 14 | |
| 10 | |
| 5 | |
| 5 |