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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Calcul8or
Frequent Visitor

Rank by process and date selection

Hi,

 

I really hope someone can help me out with this problem.

 

I need to rank values by their inconsistent process names over a date range selection, as shown in the illustration below. The process names are inconsistent because they occur randomly, and so there can be gaps between them.

 

 image.png

 

Rank has to be applied dynamically over any date range selection, and ordered according to the process hierarchy.

 

*** Once ranked, then the difference between a process and the one before it has to be calculated for each. ***

 

Can this be done?

4 REPLIES 4
Calcul8or
Frequent Visitor

@CahabaData@v-sihou-msft, thank you both for your replies. Both your suggestions work, but I should also have mentioned that this was just the first step. Once I found a way to rank processes by date range, I need to be able to offset their totals and subtract the latest from the previous, which I haven't been able to do yet.

 

Any suggestions?

as words are subject to interpretation (for instance I don't understand what is meant by "offset"...) - I suggest you provide 2 sets of data

 

i.e.

 

1. Have this

 

2. Need this

 

and if the aggregation is not obvious to us - a brief explanation of what the aggregation logic is....

 

You already have posted 3 data sets - and so it is not clear as to what would now be your starting point for the next step....

 

 

 

 

www.CahabaData.com
v-sihou-msft
Microsoft Employee
Microsoft Employee

@Calcul8or

 

In this scenario, I suggest you create a dummy column to combine Date and Order Step into numeric for ranking. 

 

You can add a column like below:

 

 

Rank Number =
1 * ( Table[Date] )
    * 1000
    + VALUE ( RIGHT ( Table[Order Step], LEN ( Table[Order Step] ) - 8 ) )

Then you can create a rank measure :

 

 

Rank =
RANKX (
    ALLSELECTED ( Table ),
    CALCULATE ( SUM ( Table[Rank Number] ) ),
    ,
    ASC,
    DENSE
)

Regards,

CahabaData
Memorable Member
Memorable Member

to my eye it looks like a sort by date, then a sort by process - - the rank is a sequential index of that sort order

 

 

www.CahabaData.com

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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