The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
6 |