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
shado26
Helper III
Helper III

Sales Order Process " time for each action "

HI All

 

need your help here as im working on new project  here the EX of my table 

 

what i want to achive here :

 

1- i need to calcuted Each action time base on action name 

2- i already tried to poivt the action name but as some action duplicated time and date show error " we need to measure each action without remove the doublication 

 

apprecite your assist to get better way as we need to have slicer for Sale name , User name , time & order No

 

OrdernoCustomerNameSalesManNameUserNameActionNameData & Time
12345678XXXXSM1SSQuote Closed2018-01-08 10:09:40.763
12345678XXXXSM1SSQuote Convert to Order2018-01-08 10:09:59.543
12345678XXXXSM1SSInitiate MKD Approval2018-01-08 10:10:24.350
12345678XXXXSM1SSDeAllocate Item2018-01-08 12:15:36.750
12345678XXXXSM1SSDeAllocate Item2018-01-08 12:15:36.780
12345678XXXXSM1SSReset Order2018-01-08 12:15:43.567
12345678XXXXSM1SSGet Approval Click2018-01-08 12:15:49.013
12345678XXXXSM1SSQuote Convert to Order2018-01-08 12:15:55.690
12345678XXXXSM1SSOrder Push for delivery2018-01-08 12:18:42.563
12345678XXXXSM1AMOrder Rejecteded by CC2018-01-08 12:20:11.577
12345678XXXXSM1SSOrder Push for delivery2018-01-08 12:23:03.777
12345678XXXXSM1AMOrder Approved by CC2018-01-08 12:45:37.377
1 ACCEPTED SOLUTION

@shado26

 

See attached file.. as well

 

shado.png


Regards
Zubair

Please try my custom visuals

View solution in original post

13 REPLIES 13
shado26
Helper III
Helper III

HI @Zubair_Muhammad

 

attached file for your advise  

 

Sales Order Process time for each action

shado26
Helper III
Helper III

Hi all,

 

i have been tried with the below attach pbix file with another solution but i found if i have duplicated action name it will not calculate the time accurate as per the highlight blue color

 

moreover i need to calculate the time to show day as well not only hours 

 

 

SOP _Test

 

 

OrdernoCustomerNameSalesManNameUserNameActionNameLogDatetimeAchive time 
1111YYYYSM1SSQuote Closed2017-01-02 14:54:53.007 
1111YYYYSM1SSQuote Convert to Order2017-01-02 14:55:31.0800:00:38
1111YYYYSM1SSInitiate MKD Approval2017-01-03 15:56:43.7701:01:13
1111YYYYSM1SKAllocate Item2017-01-10 15:24:15.84723:27:32
1111YYYYSM1SSOrder Push for delivery2017-01-15 20:12:26.5034:48:11
1111YYYYSM1FFOrder Approved by CC2017-01-16 11:22:50.17015:10:24
2222XXXXSM1SSQuote Closed2017-01-02 14:45:31.233 
2222XXXXSM1SSQuote Convert to Order2017-01-02 14:46:24.9830:00:54
2222XXXXSM1SSInitiate MKD Approval2017-01-02 14:48:05.7970:01:41
2222XXXXSM1GGAllocate Item2017-01-09 17:36:31.5332:48:26
2222XXXXSM1SSOrder Push for delivery2017-01-09 17:59:44.0300:23:12
2222XXXXSM1SS2Order Rejecteded by CC2017-01-09 18:04:14.6200:04:31
2222XXXXSM1SSOrder Push for delivery2017-01-10 15:29:37.41021:25:23
2222XXXXSM1SS2Order Approved by CC2017-01-10 15:35:02.6970:05:25

Hi @shado26,

your file is unusable, because it contains references to datasources that cannot be refreshed (without access to the sources).

 

To help you further here, please post 2 tables here:

1) Data before transformation

2) Desired results

 

Please make sure that the 2 tables match: So that there are no rows in 1) that will be ignored in 2) and vice versa

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

hello @ImkeF

 

thank for your reply , please refer to the below table 

 

in last columns this what i want to see the achieve result but in power BI ,  i need to calculate Each action time base on action name for Each OrderNo and keep the duplicate action 

 

appreciate to advice if this can be done 

 

OrdernoCustomerNameSalesManNameUserNameActionNameLogDatetimeAchive time 
1111YYYYSM1SSQuote Closed2017-01-02 14:54:53.007 
1111YYYYSM1SSQuote Convert to Order2017-01-02 14:55:31.0800:00:38
1111YYYYSM1SSInitiate MKD Approval2017-01-03 15:56:43.7701:01:13
1111YYYYSM1SKAllocate Item2017-01-10 15:24:15.84723:27:32
1111YYYYSM1SSOrder Push for delivery2017-01-15 20:12:26.5034:48:11
1111YYYYSM1FFOrder Approved by CC2017-01-16 11:22:50.17015:10:24
2222XXXXSM1SSQuote Closed2017-01-02 14:45:31.233 
2222XXXXSM1SSQuote Convert to Order2017-01-02 14:46:24.9830:00:54
2222XXXXSM1SSInitiate MKD Approval2017-01-02 14:48:05.7970:01:41
2222XXXXSM1GGAllocate Item2017-01-09 17:36:31.5332:48:26
2222XXXXSM1SSOrder Push for delivery2017-01-09 17:59:44.0300:23:12
2222XXXXSM1SS2Order Rejecteded by CC2017-01-09 18:04:14.6200:04:31
2222XXXXSM1SSOrder Push for delivery2017-01-10 15:29:37.41021:25:23
2222XXXXSM1SS2Order Approved by CC2017-01-10 15:35:02.6970:05:25

@shado26

 

Try this column

 

Column =
VAR PreviousTime =
    TOPN (
        1,
        FILTER (
            Table1,
            Table1[Orderno] = EARLIER ( Table1[Orderno] )
                && Table1[LogDatetime] < EARLIER ( Table1[LogDatetime] )
        ),
        [LogDatetime], DESC
    )
RETURN
    DATEDIFF ( MINX ( PreviousTime, [LogDatetime] ), Table1[LogDatetime], SECOND )
        / 86400

Regards
Zubair

Please try my custom visuals

@shado26

 

See attached file.. as well

 

shado.png


Regards
Zubair

Please try my custom visuals

Hi @Zubair_Muhammad

 

you are big life saver thank you alot  ,work as charm 🙂

 

i need 1 more help 

 

i used the below formula to divided the time to day/hours/min/sec 

 

Token Time = var days = int(SOP[Time Diff2]/24/60/60)
var hours = mod(int(SOP[Time Diff2]/60/60),24)
var minutes = mod(int(SOP[Time Diff2]/60),60)
var seconds = mod(SOP[Time Diff2],60)

return days &" days " & hours & " hours " & minutes & " minutes " & seconds & " seconds"

 

 

i need if i choose any order No to have card that calculate all time from start to End 

 

and if there any way to show the day as well in Time Diff 

3.JPG

 

 

 

@shado26

 

Could you show the expected output/result with the sample data you posted above?


Regards
Zubair

Please try my custom visuals

HI @Zubair_Muhammad

 

here what i want to achieve 

 

if choose the below order NO as Exp i need to see the total token time as below 

 

1 Day 18 Hours 4 Minutes 33 Seconds 

5.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

also on time Diff if we can add Day not only hours , minutes & Seconds 

shado26
Helper III
Helper III

HI ALl

 

1- action 

when i try to use pivot columns in Query if i have duplicated action name the time for this actoin will show as #Error

also remove columns Username & salesName to have signle line of order NO

 

if there any way to avoid this error as i need to see how many time this action are toke 

 

1.JPG

 

 

2- Action

even if dont remove any columns it will show #Error as well

2.JPG

 

 

 

 

apprecite your assist on this what the best way to finish this 

shado26
Helper III
Helper III

HI @v-danhe-msft

 

appreciate your quick help on this

v-danhe-msft
Employee
Employee

Hi @shado26,

From your description, I can’t figure out what you want to calculate, I guess you want to calculate the variety of each action time base on action name, right? If so, you can refer to below steps:

1.Create a measure to calculate.

Measure = var a=CALCULATE(MAX(Sheet1[Data & Time]),FILTER(ALL(Sheet1),Sheet1[ActionName]=MAX(Sheet1[ActionName])))

          var b=CALCULATE(MIN(Sheet1[Data & Time]),FILTER(ALL(Sheet1),Sheet1[ActionName]=MAX(Sheet1[ActionName])))

         return DATEDIFF(b,a,MINUTE)

1.PNG

2.Create a Slicer visual and add the [Action name] field. Create a card visual and add the [Measure] field. Now you can see the result.

2.PNG

If you want to slice by other columns, you just need to replace the [Action name] to the column you want to slice in before measure.

 

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/9p5qwe5od52ca5t/Sales%20Order%20Process%20time%20for%20each%20action.pbix?...

 

If I misunderstood what you mean, please clarify what you want to calculate.

 

Regards,

Daniel He

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

HI @v-danhe-msft

 

its nice to get touch with you again 

 

yes you correct but what i want to achive as i have many Sales order Number so i need to calculate each step for each sales order

 

we will add Slicer for Sales Name , User Name , and Time ragne but this is easy no issue with that 

 

what is really an issue we need to calculate each step can you help me with that ???

 

 

OrdernoCustomerNameSalesManNameUserNameActionName Data & TimeAchive time 
12345678XXXXSM1SSQuote ClosedAction 12018-01-08 10:09:40.763 
12345678XXXXSM1SSQuote Convert to OrderAction 22018-01-08 10:09:59.5430:00:19
12345678XXXXSM1SSInitiate MKD ApprovalAction 32018-01-08 10:10:24.3500:00:25
12345678XXXXSM1SSDeAllocate ItemAction 42018-01-08 12:15:36.7502:05:12
12345678XXXXSM1SSDeAllocate ItemAction 42018-01-08 12:15:36.7800:00:00
12345678XXXXSM1SSReset OrderAction 52018-01-08 12:15:43.5670:00:07
12345678XXXXSM1SSGet Approval ClickAction 62018-01-08 12:15:49.0130:00:05
12345678XXXXSM1SSQuote Convert to OrderAction 22018-01-08 12:15:55.6900:00:07
12345678XXXXSM1SSOrder Push for deliveryAction 72018-01-08 12:18:42.5630:02:47
12345678XXXXSM1AMOrder Rejecteded by CCAction 82018-01-08 12:20:11.5770:01:29
12345678XXXXSM1SSOrder Push for deliveryAction 72018-01-08 12:23:03.7770:02:52
12345678XXXXSM1AMOrder Approved by CCAction 92018-01-08 12:45:37.3770:22:34

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.