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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jhenscheid
Frequent Visitor

Measure on-time delivery performance and slice by origin location

I have transporation data and am displaying the carriers' performance for delivery.  However, I am trying to slice the data by where the load/trip originates.  Because I am measuring delivery performance, whenever I try to slice by the origin location, no data comes back.

 

For example, trip 123 is on time and is hauled by carrier ABC and delivers to City A.  It originated in City B.  If I put city B in the slicer, nothing comes back.

 

I deal a lot with transporation measurements and have not seen many posts pertaining to transportation topics, so if anyone needs an interpretation of the lingo, please ask for clarification.

 

Here is a small part of the data I am working with;

 

LoadIDPick LocationTypeCarrierLate Load Indicator
62180435AWARPickGRTG On-Time
62180435MFCDA4DropGRTG On-Time
62194074AWECPickCELC On-Time
62194074KFLBR2DropCELC On-Time
62260282AFUWMDropGRTGLate
62260282AWLEPickGRTGLate
62266674AWARPickPEHLLate
62266674MSSGRDropPEHL On-Time
62266674RACCI27DropPEHL On-Time
62266674RN0CIDropPEHL On-Time
62284257AWARPickTTLQLate
62284257MTSRODropTTLQ On-Time
62361052ANTODropTTLQLate
62361052AWARPickTTLQLate
62365342JCODA4DropKELW On-Time
62373595AWARPickTTLQLate
62373595MTSRODropTTLQ On-Time
62395979AWECPickSWFTLate
62395979CADCODropSWFT On-Time

 

So carrier PEHL, for example, is late for the Pick on LoadID 62266674, but on time for the Drop.  I am measuring this as on time on the delivery, but want to slice on the Pick location code.

 

Any thoughts on this or assitance would be appreciated.

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @jhenscheid,

 

In source table, create a calculated column that returns the original location for each Carrier per LoadID.

Original lacation =
CALCULATE (
    LASTNONBLANK ( 'delivery performance'[Pick Location], 1 ),
    FILTER (
        ALLEXCEPT (
            'delivery performance',
            'delivery performance'[LoadID],
            'delivery performance'[Carrier]
        ),
        'delivery performance'[Type] = "pick"
    )
)

4.PNG

 

Create an extra table which lists all distinct values of Pick Location.

Pick location table = VALUES('delivery performance'[Pick Location])

3.PNG

 

Create a one to many relationship between this new table and source table based on [Original Location].

5.PNG

 

In report page, rather than adding [Pick Location] from source table into slicer, you should add 'Pick location table'[Pick Location] into slicer. Then, when you select pick location item, the visual won't return none.

6.PNG

 

Best regards,
Yuliana Gu

 

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

View solution in original post

3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi @jhenscheid,

 

In source table, create a calculated column that returns the original location for each Carrier per LoadID.

Original lacation =
CALCULATE (
    LASTNONBLANK ( 'delivery performance'[Pick Location], 1 ),
    FILTER (
        ALLEXCEPT (
            'delivery performance',
            'delivery performance'[LoadID],
            'delivery performance'[Carrier]
        ),
        'delivery performance'[Type] = "pick"
    )
)

4.PNG

 

Create an extra table which lists all distinct values of Pick Location.

Pick location table = VALUES('delivery performance'[Pick Location])

3.PNG

 

Create a one to many relationship between this new table and source table based on [Original Location].

5.PNG

 

In report page, rather than adding [Pick Location] from source table into slicer, you should add 'Pick location table'[Pick Location] into slicer. Then, when you select pick location item, the visual won't return none.

6.PNG

 

Best regards,
Yuliana Gu

 

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi,

I try to build a measure that will return the percentage of items delivered from the total articles ordered. I have two aggregations level: order ID and article ID.

my DAX in Visual Studio, is:

% Deliv.from Order:=
AVERAGEX
(
values(Orders[Order Id]),
AVERAGEX
(
VALUES ( 'Articles'[Article Id] ),
CALCULATE
(
if
(
sum(Deliveries[Delivered Qty]) >0 && abs( sum(Deliveries[Delivered Qty]) - SUM ( 'Orders Lines'[Ordered Qty] )) / SUM ( 'Orders Lines'[Ordered Qty] )<=0.03, 1, 0
)
)
)
)

 

it's working to the article level, but not to the order level

this formula have to return in grand total: 94.74%

article count19
article not delivered 100%1
=(I32-I33)/1994.74%

look below table:

table : order lines (line by line - article)

Row LabelsOrdered Qty AYDelivered Qty AYDelivered Qty For SLService Level Qty AY% Deliv.from Orde
2001043689823 (no of order)     
 FITNESS STRAWBERRY 23.5G2,064.002,064.002064100.00%100.000%
FITNESS SIMPLU BATON 23.5G3,440.003,440.003440100.00%100.000%
NESQUIK CEREALE 250G672.00640.0064095.24%0.000%
CHOCAPIC CEREALE 250G1,056.001,056.001056100.00%100.000%
 CHEERIOS CEREALE 250G864.00864.00864100.00%100.000%
 CINI MINIS CEREALE 250G384.00384.00384100.00%100.000%
 CINI MINIS 500 G120.00120.00120100.00%100.000%
CORNFLAKES NESTLE 500G816.00816.00816100.00%100.000%
 NESQUIK DUO CEREALE INTEGRALE 460G900.00900.00900100.00%100.000%
 NESQUIK DUO CEREALE 225G960.00960.00960100.00%100.000%
 STRAWBERRY MINIS 500G180.00180.00180100.00%100.000%
 FITNESS FRUCTE CEREALE 425G480.00480.00480100.00%100.000%
 FITNESS CEREALE 425G900.00900.00900100.00%100.000%
NESQUICK ABC 460G540.00540.00540100.00%100.000%
FITNESS  DELICE WHITE CHOCO 22.5G1,376.001,376.001376100.00%100.000%
FITNESS CHOCO CEREALE  425G240.00240.00240100.00%100.000%
CHEERIOS OATS 400G792.00792.00792100.00%100.000%
CORN FLAKES MIERE SI ARAHIDE 450G576.00576.00576100.00%100.000%
FITNESS PEACH APRICOT BATOANE CEREALE 23.5G2,064.002,064.002064100.00%100.000%
Grand Total18,424.0018,424.001839299.83%0.049% = it is wrong (here have to be 94.74%

 

Could you please help me to correct this DAX formula to obtain correct data on the order level?

 

Sincerely

Alina

This worked exactly as needed!!  Thank you for your help.  Much appreciated!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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