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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply

Rank based on Ranked Index

I am trying to find the average time spent in status or with a set issue. I have created a hierarchical sort in the Power Query Editor based on the issue category, initiative key, and the update date. Then, I added an index column, which I created a ranked index for each Initiative key, as seen here: 

DAXtheDestroyer_0-1657833222815.png

resulting in the table seen here (sensitive data removed):

DAXtheDestroyer_1-1657833260087.png

I would like to create a ranked column for each consecutive issue following the same process here and another for each consecutive R/Y/G status, that resets for each initiative key . Perhaps a "Ranked Issue" and "Ranked Status" column?

Something like this:

DAXtheDestroyer_2-1657835697981.png

(Apologies for my hasty photo editing skills)

Using the rankings, I believe I can ultimately calculate the average maximum ranking of issue or status to show the average amount of weeks they impact projects (initiative keys). Every entry is conducted weekly to append the table, and the rank could artificially serve as a dynamic counter of those consecutive weeks. I would like to show cards similar to these which I previously mocked up:

DAXtheDestroyer_3-1657835788847.png

 

DAXtheDestroyer_4-1657835796188.png

Thank you.

 

3 REPLIES 3
amitchandak
Super User
Super User

@DAXtheDestroyer , Create two new columns

 

Rankx(filter(Table, [Issue Id] = earlier([Issue_id])) , [Index],asc,dense) //you use date inplace of index

 

and

 

Rankx(filter(Table, [Issue Id] = earlier([Issue_id]) && [Issue category short] = earlier([Issue category short]) ) , [Index],asc,dense) //you use date inplace of index

This does work with the change in issues. However, I cannot replicate it for the status changes because if on initiative key has multiple issues assigned, they will have repeated rows for each extra issue. This causes the status ranking counter to continue rather than resetting at the change of issue, as seen below for Initiative Key 213. 

DAXtheDestroyer_0-1657912221157.png

The R/Y/G column drives the "On Track Status" column, and we see that there are really only 11 consecutive weeks of "Missing" status, rather than 22.

I believe I solved the running counter problem, seen below:

DAXtheDestroyer_0-1657919108936.png

Is there a way to calculate the average maximum rank for the new columns?

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.