Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance 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 |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
9 | |
6 |