Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Dear community,
I have a table to record dept of customers. Then I wrote a dax to calculate Topn dept such as below:
Dept TOPN =
var top_n = SELECTEDVALUE('TOPCUSTOMER'[TOP], 3)
var table_1 = SUMMARIZECOLUMNS(Customer[Customer ID], "Total Dept", SUM(Customer[Dept]))
return Calculate(SUM(table_1[Total Dept]), TOPN(top_n, table_1, [Total Dept], DESC))
But at the return step, I can't find column [Total Dept] (red tex) of table_1 (created with var keyword). Please explain for me this case
Thank you
Ops, someone help me?
@neonguyen1803 Maybe:
Dept TOPN =
var top_n = SELECTEDVALUE('TOPCUSTOMER'[TOP], 3)
var table_1 = SUMMARIZECOLUMNS(Customer[Customer ID], "Total Dept", SUM(Customer[Dept]))
return Calculate(SUMX(table_1,[Total Dept]), TOPN(top_n, table_1, [Total Dept], DESC))
Hi Greg,
I tried your solution, and can find the column but the results are wrong.
This is the total debt of all customers. The result does no change when I change Topn rank, eg. change to top3 or top 5 still get the result is 14.18bn
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
8 | |
7 |