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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi there,
Percentage Attainment % = DIVIDE([PAC2],[PWR],0) PAC2 = IF(HASONEVALUE(AssessData[Term]) && HASONEVALUE(AssessData[Subject]) , CALCULATE(COUNTA(AssessData[Assessment]), AssessData[Assessment]<>"" ), 0 ) PWR = IF(HASONEVALUE(AssessData[Term]) && HASONEVALUE(AssessData[Subject]) , CALCULATE( COUNTA(AssessData[Assessment]), ALL(AssessData[PerCentAttainName]), AssessData[Assessment]<>"" ), 0 )
Solved! Go to Solution.
I have found the solution (if you are interested!) - a blog article posted by Chris Webb (well done, Chris!) - https://blog.crossjoin.co.uk/2015/12/15/power-bi-desktop-sort-by-column-and-dax-calculations-that-us...
I removed the measure [PWR] and [Percentage Attainment %], replacing the latter with:
PA2 = DIVIDE([PAC2],
CALCULATE([PAC2],
ALL(AssessData[PerCentAttainName],AssessData[PerCentAttainID])
)
,0)
The percentages now flow through irrespective of whether the Sort By Column function has been applied. Phew.
Faced this issue while applying Sort by on a text column having both numbers and text that needs to sort by a custom order. This method work with ALL(column,sortorder) applied. Thanks!
I have found the solution (if you are interested!) - a blog article posted by Chris Webb (well done, Chris!) - https://blog.crossjoin.co.uk/2015/12/15/power-bi-desktop-sort-by-column-and-dax-calculations-that-us...
I removed the measure [PWR] and [Percentage Attainment %], replacing the latter with:
PA2 = DIVIDE([PAC2],
CALCULATE([PAC2],
ALL(AssessData[PerCentAttainName],AssessData[PerCentAttainID])
)
,0)
The percentages now flow through irrespective of whether the Sort By Column function has been applied. Phew.
I was looking for a solution for this, and I never imagined it could be such a small thing making my life difficult. 😅
Thanks for sharing.
Woah, I had the same issue but with ALLSELECTED() instead of ALL().
Works in ALLSELECTED() too!
Thank you.
@Anonymous I ran into this issue and your post helped me fix my problem and for that I want to thank you!
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 58 | |
| 53 | |
| 43 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 123 | |
| 107 | |
| 44 | |
| 32 | |
| 24 |