Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Can someone please help me to calculate
Solved! Go to Solution.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
Quartile:
You may create a measure as below.
Percentage =
var total = CALCULATE(DISTINCTCOUNT('Table'[CustomerID]),ALL('Table'))
var tab =
ADDCOLUMNS(
ALL('Table'),
"Rank",
RANKX(
ALL('Table'),
[Revenue Contribution],,ASC
)
)
var newtab =
SUMMARIZE(
Quartile,
Quartile[Quartile],
"Count",
SWITCH(
[Quartile],
"quartile1",
DIVIDE(
COUNTROWS(
FILTER(
tab,
[Rank]>=1&&[Rank]<total*0.25
)
),
total
),
"quartile2",
DIVIDE(
COUNTROWS(
FILTER(
tab,
[Rank]>=total*0.25&&[Rank]<total*0.5
)
),
total
),
"quartile3",
DIVIDE(
COUNTROWS(
FILTER(
tab,
[Rank]>=total*0.5&&[Rank]<total*0.75
)
),
total
),
"quartile4",
DIVIDE(
COUNTROWS(
FILTER(
tab,
[Rank]>=total*0.75&&[Rank]<=total )
),
total
)
)
)
return
SUMX(
newtab,
[Count]
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Please share some data to work with.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
Quartile:
You may create a measure as below.
Percentage =
var total = CALCULATE(DISTINCTCOUNT('Table'[CustomerID]),ALL('Table'))
var tab =
ADDCOLUMNS(
ALL('Table'),
"Rank",
RANKX(
ALL('Table'),
[Revenue Contribution],,ASC
)
)
var newtab =
SUMMARIZE(
Quartile,
Quartile[Quartile],
"Count",
SWITCH(
[Quartile],
"quartile1",
DIVIDE(
COUNTROWS(
FILTER(
tab,
[Rank]>=1&&[Rank]<total*0.25
)
),
total
),
"quartile2",
DIVIDE(
COUNTROWS(
FILTER(
tab,
[Rank]>=total*0.25&&[Rank]<total*0.5
)
),
total
),
"quartile3",
DIVIDE(
COUNTROWS(
FILTER(
tab,
[Rank]>=total*0.5&&[Rank]<total*0.75
)
),
total
),
"quartile4",
DIVIDE(
COUNTROWS(
FILTER(
tab,
[Rank]>=total*0.75&&[Rank]<=total )
),
total
)
)
)
return
SUMX(
newtab,
[Count]
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, please note that the CustomerID and Revenue are in two different tables as per my data.
Could you please help on that
@Anonymous , I think you have Box and Whisker chart for that. See if that can help
https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA104380831?tab=Overview
refer for quartile
https://sqldusty.com/2018/08/31/calculating-quartiles-with-dax-and-power-bi/
I tried but that's not working
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |