Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

top n

hi
i am trying to display top 1 place name from place table.
i tried using this formula didnt work

top = TOPN (1,Place,Place[place_name],DESC)
 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

    What you are creating is a measure or calculate column, right? Actually, it will return a table with the top N rows of Place table when  you use TOPN function. You can refer the content in the following threads to get the top 1 place name.

    Dax Top 1 Name

    Display Top 1 customer on Card Visual

    If the above ones are not applicable for your scenario, please provide some sample data in Place table (exclude sensitive data) and your expected result with example and backend logic. Thank you.

    Best Regards

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    You can't return a whole row from a table into a measure/column. You have to return a scalar value.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    What you are creating is a measure or calculate column, right? Actually, it will return a table with the top N rows of Place table when  you use TOPN function. You can refer the content in the following threads to get the top 1 place name.

    Dax Top 1 Name

    Display Top 1 customer on Card Visual

    If the above ones are not applicable for your scenario, please provide some sample data in Place table (exclude sensitive data) and your expected result with example and backend logic. Thank you.

    Best Regards