Im trying to add just a simple rank numbering or row number to column but no luck. I have a simple test table which consist of 2 columns - Name and Room number. I have attached Room Number to filter so it can be filtered. My goal is to add a number to resulted raws. Im using dax measure for this but no luck. This is my DAX measure code:

Visitor num = RANKX('myTab',CALCULATE(count('myTab'[Name])))

But it returns only 1 for each rowenter image description here

enter image description here

My PBIX file

1 Answer

Try changing the filter context:

Visitor num = RANKX(ALLSELECTED('myTab'),CALCULATE(MAX('myTab'[Name])))

enter image description here

6

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.