none
Rank issue in DAX Azure Analysis Service Tabular RRS feed

  • Question

  • We are trying to calculate rank using RANKX function in DAX with the steps below .

    1.Derive the measure in Fact Sales Table 

    2.User want to see the rank for sales amount w.r.t Location(Dimension) in 1 tab and in another User want to see the rank for sales amount w.r.t to Divison(Dimesion)

    3.Sales Amount is same when calculating rank w.r.t location and division
    Issues:-

    1.Sometimes the rank value is matching. sometimes the rank value is increased by 1.

    Please suggest for the same



    • Edited by SubhadipRoy Tuesday, August 13, 2019 8:00 AM
    Tuesday, August 13, 2019 7:57 AM

All replies

  • If the data type of the measure is decimal number, you should convert the data type to fixed decimal number for RankX to work reliably. For example, instead of RankX(<column>, <measure>), you could write RankX(<column>, CURRENCY(<measure>)). Despite its name, the CURRENCY function effectively converts the input value to a fixed decimal number.
    Tuesday, August 13, 2019 11:19 PM
  • @Jeffrey Wang - AS Thank you for the response.

    Hi SubhadipRoy, Just checking to see if your issue was resolved with Jeffery Wang's suggestion. If so, please consider to click “Mark as Answer” and/or Up-Vote the reply that was helpful, as it might be beneficial to other community members reading this thread. And, if you have any further query do let us know.

    Thank you

    If a post helps to resolve your issue, please click the "Mark as Answer" of that post and/or click Answered "Vote as helpful" button of that post. By marking a post as Answered and/or Helpful, you help others find the answer faster.

    Wednesday, August 14, 2019 5:36 PM
    Moderator
  • Hi SubhadipRoy,

    Just checking to see if your issue was resolved? If so please consider sharing the resolution here, so the it will be beneficial to other members of the community. If you have any further query, do let us know.


    Thank you

    If a post helps to resolve your issue, please click the "Mark as Answer" of that post and/or click Answered "Vote as helpful" button of that post. By marking a post as Answered and/or Helpful, you help others find the answer faster.

    Thursday, August 15, 2019 6:56 PM
    Moderator