Forum Discussion
Alex_Hasan
4 years agoHelper II
TopN dax function is not working
Hello guys, This is the problem I'm having right now while extracting Top 10 customers. You see the image, it's not showing proper value. here is my dax function. Top 10 customers = ...
- 4 years ago
I got the solution just now. In your coding, the DimCustomer[FirstName] has been mentioned two times. So I replaced one with [Total sales] and it's showing the top 10 that I wanted.
Top 10 customers =
CALCULATE(
[Total Sales],
KEEPFILTERS(
TOPN( 10, ALLSELECTED( DimCustomer[FirstName] ), [Total sales], ASC )
)
)
CNENFRNL
4 years agoCommunity Champion
Top 10 customers =
CALCULATE(
[Total Sales],
KEEPFILTERS(
TOPN( 10, ALLSELECTED( DimCustomer[FirstName] ), DimCustomer[FirstName], ASC )
)
)Alex_Hasan
4 years agoHelper II
I got the solution just now. In your coding, the DimCustomer[FirstName] has been mentioned two times. So I replaced one with [Total sales] and it's showing the top 10 that I wanted.
Top 10 customers =
CALCULATE(
[Total Sales],
KEEPFILTERS(
TOPN( 10, ALLSELECTED( DimCustomer[FirstName] ), [Total sales], ASC )
)
)