Forum Discussion

TechoGirl0's avatar
TechoGirl0
Frequent Visitor
4 years ago
Solved

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
    )

  • 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

     

2 Replies

  • Samarth_18's avatar
    Samarth_18
    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