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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Rankx Function - starts from 2 when ranking ASC

Hello PBI Team,
Rankx function starts from 2 when used order is ASC. Seems the problem comes from the fact, that there is a incative relationship with the table/column that Ranking is based on. In my case, I use MS WideWorldImportersDW database and Fact.Order and Dimession.Date - active relaion Fact.Order[Order Date Key]-Dimession.Date[Date], inactive relation Fact.Order[Picked Date Key] -Dimession.Date[Date].
When inactive relationship is removed, the results are correct .
Test DAX qry:
DEFINE
MEASURE Orders[Sales Amount] = SUMX('Orders','Orders'[Quantity]*'Orders'[Unit Price])


EVALUATE
SUMMARIZECOLUMNS(
'Date'[Calendar Month Number],
TREATAS({2015},'Date'[Calendar Year]),
"@Sales Amount", [Sales Amount],
"Rank",RANKX ( ALL ( 'Date'[Calendar Month Number] ), [Sales Amount],, ASC)
)

ORDER BY [@Sales Amount] ASC

 

Status: New
Comments
v-chuncz-msft
Community Support

@kaloyan_a 

 

You may take a look at this article.