Forum Discussion
ranking on text column
- 2 years ago
Hi Jessica_17
Try to use the measure :rank_text = RANKX(ALLSELECTED('Table'[batch]),CALCULATE(max('Table'[batch])),,ASC)Result :
pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly - 2 years ago
Hi Jessica_17
Did you download a pbix and folllowed my steps?
If yes , please share link to the pbix of yours and i will try to help.
- 2 years ago
you can do this in power query.
it will be better this way - 2 years ago
Hi Jessica_17
What is the ranking's purpose?
If the rank should be static, you can use Ahmedx's suggestion.
If the table has duplicate batches.
You can duplicate the table, remove all unnecessary columns, and add an index column (with power query like in the attached images.
If the batches are unique you can just add an index.create a relationship
And use the index as a needed rank (note that you have duplicates)
if you need it as a dynamic measure :
Use a measure
rank_dynamic = RANKX(all('Table'),CALCULATE(max('Table'[batch])),,ASC)New pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- Anonymous2 years ago
Hi Jessica_17 ,
You can create a measure as below to get it, please find the details in the attachment.
Rank = RANKX ( ALL ( 'Table1' ), CALCULATE ( MAX ( 'Table1'[Batch] ) ),, ASC, DENSE )Best Regards
- 2 years ago
hi, Jessica_17
try below for measure formulausing measure = RANK(DENSE,ALL('Table'[Batch],'Table'[Jobs]),ORDERBY('Table'[Batch],ASC,'Table'[Jobs],ASC))for column try below
using column = RANK(DENSE,ALL('Table'[Jobs],'Table'[Batch]),ORDERBY('Table'[Batch],asc,'Table'[Jobs],asc))If this post helps, then please consider Accept it as the solution to help the other members find it
- 2 years ago
to know how to do this watch my video
HI Ahmedx
I tried it in power query too, but it is not still not working.
to help you, tell us what didn’t work for and where
show on the screenshot or post the data where the rank is violated
- Jessica_172 years ago
Helper V
HI Ahmedx
I am getting this error while using measures provided by other folks or even creating index column in power query.measure I am using is this
Row_Number =
RANKX(all('TableA cycle_step'[eq_no],'TableA cycle_step'[job_id], 'TableA cycle_step'[cntr_no], 'TableAcycle_step'[job_cmpl_time], 'TableAcycle_step'[job_fetching_time], 'TableAcycle_step'[from_loc]),'TableAcycle_step'[eq_no],MIN('TableAcycle_step'[eq_no]),ASC)
Ritaf1983 , Dangar332
Here is the sample screenshot of original data , with the error by applying your method
and also a measure is being used to filtere this data
ME =
VAR HourStep = SELECTEDVALUE('TableBhist cycle_step'[Hour_step])
VAR JobID = SELECTEDVALUE('TableAcycle_step'[job_id])
RETURN
IF(min('TableAcycle_step'[Hour_step]) = sELECTEDVALUE('TableBhist job_activity'[Hour_step]),1,0)
when this filter is applied the number also gets changed.- Dangar3322 years ago
Resident Rockstar
hi, Jessica_17
- Ahmedx2 years ago
Super User
to know how to do this watch my video
- Jessica_172 years ago
Helper V
HI Ahmedx
Will this be feasible method even after the data source connectivity method gets changed to direct query in future?