Forum Discussion

broeren79's avatar
broeren79
Frequent Visitor
6 years ago
Solved

on time delivery

Hi all,

 

Newby here, please go easy.

I need to be able to visualize some performance measurements based on variables spread over 3 tables.

My table structure:

Table1: Incidents

IncidentIDIncidentNr
11A1202-2345
12A1202-2360
13A1202-2370

 

Table2: Incidentdurationblocks

DurationBlockIDDurationNameIDIncidentIDDuration
111190
211160
321330

 

Table3: DurationNames

DurationNameIDNameTarget
1Registered60
2In Process90
3On Hold30

 

I need to generate 2 visualizations:

1 were i show a list of incidents where, per incident i can show "on time" or "late" when comparing the duration with target.

1 where i show a percentage on time for tickets comparing duration with target, with the option to filter per DurationName.

 

I probably need to do this using measures, but as a historical

  • Hi broeren79 

     

    Assuming that your model looks like this 

     

    you can create a calc column to get you on time and late values

    Status = if([Duration] > RELATED(DurationNames[Target]), "Late", "On Time")

    and a measure for your % on time

    % On Time = DIVIDE(CALCULATE(COUNTROWS('Incidentdurationblocks'), filter('Incidentdurationblocks','Incidentdurationblocks'[Status] = "On Time")), COUNTROWS('Incidentdurationblocks'))

     

    I hope this helps,

     

    Richard

6 Replies

  • richbenmintz's avatar
    richbenmintz
    Icon for Resident Rockstar rankResident Rockstar

    Hi broeren79 

     

    Assuming that your model looks like this 

     

    you can create a calc column to get you on time and late values

    Status = if([Duration] > RELATED(DurationNames[Target]), "Late", "On Time")

    and a measure for your % on time

    % On Time = DIVIDE(CALCULATE(COUNTROWS('Incidentdurationblocks'), filter('Incidentdurationblocks','Incidentdurationblocks'[Status] = "On Time")), COUNTROWS('Incidentdurationblocks'))

     

    I hope this helps,

     

    Richard

    • broeren79's avatar
      broeren79
      Frequent Visitor

      Thanks richbenmintz , It was the "related" function i overlooked.
      For the on time delivery percentage I multiplied it by 100 to get the percentage, but that's a minor thing.

  • edhans's avatar
    edhans
    Icon for Community Champion rankCommunity Champion

    Hi broeren79 ,

     

    See if this helps. I am not sure I fully understood your desired output, so I may need to redo the formulas. 

    My PBIX is here so you can see the measures I used to calculate the Time Status and Percent On Time columns. Also note in Power Query I merged your last two tables together. No point in them being separate in the model that I can see.

     

     

    • broeren79's avatar
      broeren79
      Frequent Visitor

      thanks edhans can't open the pbix-file. it seems to be a zip file with different content, but no pbix file.
      Also note, i can't merge the tables in the data source, as the data source is from an api of our SaaS support tool.