0

I have used below DAX Expression for getting top 10 customers based on one column of a table

TOP10CUSTOMERS:=
  VAR SRANK = RANKX(ALL('TableName'[CustomerName])
                   ,[Columnvalue]
                   ,
                   ,DESC
                   )
  return IF(SRANK <= 10
           ,[columnvalue]
           ,blank()
           )

Its giving results as expected.But now the requirement is to rank customers based on two columns instead of one column. DAX expression is as below:

TOP10CUSTOMERS:=
  VAR STPRANK = RANKX(ALL('tableName'[CustomerName])
                     ,[Columnvalue1] && [Columnvalue2]
                     ,
                     ,DESC
                     )
  return IF(STPRANK <=10
           ,[Columnvalue1]
           ,blank()
           )

its not working in this case.

Could you please suggest what is the issue with above DAX Expression

iamdave
  • 12,023
  • 3
  • 24
  • 53
  • Please add details on what you mean by *"not working"*, we can't help you if we don't know the problem you are facing. – iamdave Nov 30 '20 at 12:29
  • You can also find detailed info on multiple column ranking in DAX here: https://www.sqlbi.com/articles/rankx-on-multiple-columns-with-dax-and-power-bi/?nu=51717 – iamdave Nov 30 '20 at 12:30
  • not working means when i pull TOP10CUSTOMERS the measure gives more than 10 values and not accurate also – harika dasa Nov 30 '20 at 12:48
  • It would help if you could add some source data, your expected result and what you are currently getting – iamdave Nov 30 '20 at 13:13

0 Answers0