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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Aeolus
Frequent Visitor

Index Ranking user with time

Hi Community,

 

I hope you can help me with the following: I want to calculate the time duration of a specific process by a specific user (gebruiker) but have not got further than calculating the time difference between the next process entry.

 

Current setup:

Start Time = VAR Previous = if(Table[GR Index Total]>1;Table[GR Index Total]-1;0) RETURN calculate(max(Table[datum_tijd]);filter(Table;Table[GR Index Total]=Previous))
" the next ret_date entry from the user when they perform a 'goods receipt' action"
 
 End time = ret_date
"the end time of the user initiated 'goods receipt' action"
 
GR Index Total = IF(Table[Process Description]="Goods Receipt";RANKX(FILTER(Table;Table[Process Text]="process_receipt");Table[ID];Table[ID];ASC);0)
"Indexing the goods receipt entries (there are other processes) in order based on ID"

 

IndexQuestion.JPG

 

What should happen: 

 

ID 1291284, user "chefra", process description "Goods Receipt" should have an end time equal to ret_date and a start time equal to ret_date used in ID 1291174 (13:22:10) = time difference of 27 minutes instead of the 19 currently calculated.

 

Result should be a proper bell curve for all users doing goods receipt instead of what i get now (see example)

 

image.png

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @Aeolus ,

 

You could update your DAX :

GR Index Total =
IF (
    Table[Process Description] = "Goods Receipt";
    RANKX (
        FILTER (
            Table;
            Table[Process Text] = "process_receipt"
                && 'Table'[gebruiker] = EARLIER ( 'Table'[gebruiker] )
        );
        Table[ID];
        Table[ID];
        ASC
    );
    0
)
Start Time =
CALCULATE (
    FIRSTNONBLANK ( 'Table'[ret_dat]; 1 );
    FILTER (
        'Table';
        'Table'[GR Index Total]
            = EARLIER ( 'Table'[GR Index Total] ) - 1
            && 'Table'[gebruiker] = EARLIER ( 'Table'[gebruiker] )
    )
)

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @Aeolus ,

 

You could update your DAX :

GR Index Total =
IF (
    Table[Process Description] = "Goods Receipt";
    RANKX (
        FILTER (
            Table;
            Table[Process Text] = "process_receipt"
                && 'Table'[gebruiker] = EARLIER ( 'Table'[gebruiker] )
        );
        Table[ID];
        Table[ID];
        ASC
    );
    0
)
Start Time =
CALCULATE (
    FIRSTNONBLANK ( 'Table'[ret_dat]; 1 );
    FILTER (
        'Table';
        'Table'[GR Index Total]
            = EARLIER ( 'Table'[GR Index Total] ) - 1
            && 'Table'[gebruiker] = EARLIER ( 'Table'[gebruiker] )
    )
)

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi V-eachen,

 

Works like a charm!!

 

Thank you,

Aeolus

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors
Top Kudoed Authors