Forum Discussion
TopN dax function is not working
- 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 )
)
)
Top 10 customers =
CALCULATE(
[Total Sales],
KEEPFILTERS(
TOPN( 10, ALLSELECTED( DimCustomer[FirstName] ), DimCustomer[FirstName], ASC )
)
)- Alex_Hasan4 years ago
Helper II
Hi CNENFRNL , thanks for your response. I tried with your function. It is showing this -
I think the function was supposed to show this one with top 10.
- KarinaUrtazu3 years ago
Advocate II
Para que muestre esos valores, cambia el ASC por DESC y solo con eso debería ser suficiente
- Alex_Hasan4 years ago
Helper 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 )
)
)