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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello Community,
I am trying to create a formula in TOPN to select Top 10 customers' sales
, but when i create it, show me all customers' sales but the total of sales is for Top 10 customers' name. Please let me know if you need more Info.
as below:
Thanks in advance for your suggestions.
Solved! Go to Solution.
How about
Top Sales =
VAR Top10 =
TOPN (
10,
ALLSELECTED ( Dim_Customer[CustomerName] ),
[CM_SalesInvoiceLine_Amount_ExclAll_LCY]
)
RETURN
CALCULATE ( [CM_SalesInvoiceLine_Amount_ExclAll_LCY], KEEPFILTERS( Top10 ) )
Try
Top Sales =
CALCULATE (
[CM_SalesInvoiceLine_Amount_ExclAll_LCY],
TOPN (
10,
ALLSELECTED ( Dim_Customer[CustomerName] ),
[CM_SalesInvoiceLine_Amount_ExclAll_LCY]
)
)
I got this, when i applicate your formula, Thanks for your interesting
How about
Top Sales =
VAR Top10 =
TOPN (
10,
ALLSELECTED ( Dim_Customer[CustomerName] ),
[CM_SalesInvoiceLine_Amount_ExclAll_LCY]
)
RETURN
CALCULATE ( [CM_SalesInvoiceLine_Amount_ExclAll_LCY], KEEPFILTERS( Top10 ) )
Sorry, the same result
I've edited my post to add KEEPFILTERS, I think that should do it.
User | Count |
---|---|
15 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
29 | |
18 | |
15 | |
7 | |
6 |