Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
TechoGirl0
Frequent Visitor

TOPN Question

Hi, I am new to this community and am trying to advance my DAX knowledge for my job. Could someone tell me what the numbers below the columns represent?

Thank you!

 

VAR __SomeVariable = 
    TOPN(
      502,
      __SomeTable,
      [Column1],
      0,
      [Column2],
      0,
      'Product'[Column3],
      1,
      'Location'[Column4],
      1,
      'Location'[Column5],
      1
    )

2 ACCEPTED SOLUTIONS
Samarth_18
Community Champion
Community Champion

Hi @TechoGirl0 ,

 

If you look at the syntax of TopN ,

- 502 is the number of rows to return 

- 1 or 0 is the order to be applied. 0/FALSE/DESC – descending; 1/TRUE/ASC – ascending.

Syntax = 
TOPN(<n_value>, <table>, <orderBy_expression>, [<order>[, <orderBy_expression>, [<order>]]…]) 

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

v-zhangti
Community Support
Community Support

Hi, @TechoGirl0 

 

vzhangti_0-1646882198699.png

Here is the related document, hope it can help you.

https://docs.microsoft.com/dax/topn-function-dax 

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @TechoGirl0 

 

vzhangti_0-1646882198699.png

Here is the related document, hope it can help you.

https://docs.microsoft.com/dax/topn-function-dax 

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Samarth_18
Community Champion
Community Champion

Hi @TechoGirl0 ,

 

If you look at the syntax of TopN ,

- 502 is the number of rows to return 

- 1 or 0 is the order to be applied. 0/FALSE/DESC – descending; 1/TRUE/ASC – ascending.

Syntax = 
TOPN(<n_value>, <table>, <orderBy_expression>, [<order>[, <orderBy_expression>, [<order>]]…]) 

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.