Forum Discussion

nleuck's avatar
nleuck
Post Patron
6 years ago

Rank by measure in Direct Query

Hello All,

 

I'm trying to rank Branch Locations by a measure that finds the % of products with no sales to total inventory. When I try to create the rank measure in the visual all the locations are ranked #1. I haven't had much luck with the rank function in Power BI but maybe I'm doing something wrong.

 

Formula: RANKX(ALLSELECTED(table1[Branch Location], CALCULATE(DIVIDE(SUM(table2[no sales value]), SUM(table1[total inventory value])),,DESC,Skip)

 

I've seen other examples and it works just fine for those users, but can't figure out why it won't work for me.

 

Any ideas?

 

Thanks

30 Replies