Forum Discussion

Oomsen's avatar
Oomsen
Icon for Helper III rankHelper III
7 years ago
Solved

Measure delivery on time

I would like to create a measure which gives me a % deliveries on time.

 

My data:

Order                Planned                 Delivered                 Differences

60004                29-01-2019           18-01-2019              -11

60005                22-01-2019           22-01-2019             0 

60006                12-02-2019           14-02-2019             2

60007                01-03-2019           15-03-2019             14

 

My expectation is that 25% is delivered to early, 25% on time and 50% to late. 

Extra detail is that ordernumber and planned date are from the same table but delivered date is from a different table. 

  • Hi Oomsen 

    Based on my test,my formula could work.Could you show some screenshot or more details so that we could help further on it?

    Regards,

5 Replies

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

    Hi Oomsen 

    You can use the expresion below.

     

    YourMeasure = 
    DIVIDE(
        CALCULATE(
            COUNT(YourTable[Order]),
            YourTable[Differences] = 0
        ),
        COUNT(YourTable[Order])
    )


    Hope this helps
    Mariusz

    • Oomsen's avatar
      Oomsen
      Icon for Helper III rankHelper III

      Thank you for the respons. 

      It doesn't work. Maybe because "YourTable[Differences]" is a measure in my report. 

  • v-cherch-msft's avatar
    v-cherch-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Oomsen 

    You may try below measures:

    early =
    COUNTROWS ( FILTER ( Table1, [Differences] < 0 ) )
        / COUNTROWS ( Table1 )
    
    On time =
    COUNTROWS ( FILTER ( Table1, [Differences] = 0 ) )
        / COUNTROWS ( Table1 )
    
    late =
    COUNTROWS ( FILTER ( Table1, [Differences] >0 ) )
        / COUNTROWS ( Table1 )
    

    Regards,

    • Oomsen's avatar
      Oomsen
      Icon for Helper III rankHelper III

      [Differences] is a measure so this doesn't work unfortunately. 

      • v-cherch-msft's avatar
        v-cherch-msft
        Icon for Microsoft Employee rankMicrosoft Employee

        Hi Oomsen 

        Based on my test,my formula could work.Could you show some screenshot or more details so that we could help further on it?

        Regards,