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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
lotus22
Helper III
Helper III

Remove a entry in PowerBi based on next entry

lotus22_0-1724952545865.png

 

In picture we have a machine RW100 Side A where fail entry created by Operator 10314. The operator was able to fix the late entry with in 5 mins as we see next entry 159. How do I remove the late entry from PowerBI or exclude it when the new entry shows up within 5 mins?

 

10314 is Operator ID. Minutes is (minutes between created and now) which do not mean anything here.

 

8 REPLIES 8
TheoC
Super User
Super User

@lotus22 I am pretty sure that's the logic applied in tblRemoved?  If not, can you do me a favour and highlight the exact output you want based on the rows you have in the sample data?

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC  The entries removed should only be late and not completed. The completed is good.

Yes, @lotus22.  I understand that.  That is what I did already in the 'tblRemoved' table for you in the PBIX file I attached earlier.  If this isn't the output you want, can you please tell me which rows are the output you want based on your sample data.

 

TheoC_0-1724958395679.png

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

We only need to remove late entries where subsequent for the same Machine and Operator are within 5 minutes.

 

We look for first late entry, capture machine and operator. Look for similar entry with same Machine and Operator in next 5 minutes. If there is nothing then we register the late entry.

 

If there is entry within 5 minutes, then we remove the late entry.

 

The goal is that operator has fixed the late entry in 5 minutes or less.

@lotus22 

 

I don't know how to ask this in any different manner and there's clearly a miscommunication happening somewhere, so I will make one more effort to help in this instance then I will need to allow another member of the Community assist with this post:

 

Question:  Which of the rows in your sample data meet the requirement you are wanting?  

 

The expected response should list ID #152, #153..... #170...  

 

Please tell me what you want the output to be based on your sample data.

 

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC  Thank you and sorry for the confusion. I simplified the data little bit and revert back to raw data.  In Raw, we have item requested from Operator. If it is requested then there should be response back. The response  can come from operator or the supervisor. But there has to be response for that machine. If the response doesn't come in 5 mins then we mark it "LATE". If it does come back in 5 minutes, then we mark it "DELETE"

 

I have added Mark Column and also the comments. hope this helps Please see attached

 

IdCreatedCreatedByModifiedModifiedByDeletedStateMachineCustomShiftMark 
1598/29/2024 9:1510314  FALSE1RW100 Side APass1  
1588/29/2024 9:1510314  FALSE2RW100 Side AFail1  
1578/29/2024 9:1354114  FALSE4BC213Complete1  
1568/29/2024 9:1354114  FALSE1BC213Pass1  
1558/29/2024 9:1254167  FALSE1CA210Pass1  
1548/29/2024 9:1254167  FALSE4CA210Complete1  
1508/29/2024 9:0433868  FALSE1RW210Pass1  
1498/29/2024 9:0433868  FALSE4RW210Complete1  
1488/29/2024 9:0210326  FALSE4WC006Complete1  
1478/29/2024 9:0010235  FALSE3CA210Requested1LateMark it late as the next entry is at 154 which is more than 5 mins
1468/29/2024 8:5954114  FALSE3BC213Requested1LateMark it late as the next entry is at 156 which is more than 5 mins
1098/29/2024 7:1034989  FALSE1WC100 Side APass1  
1068/29/2024 7:0910270  FALSE4RW002Complete1  
1058/29/2024 7:0910270  FALSE3RW002Requested1  
1048/29/2024 7:0834989  FALSE4WC100 Side BComplete1  
1038/29/2024 7:0834989  FALSE1WC100 Side BPass1  
1028/29/2024 7:0834989  FALSE3WC100 Side BRequested1  
1018/29/2024 7:0510317  FALSE4WC011 Side AComplete1  
1008/29/2024 7:0510317  FALSE1WC011 Side APass1  
998/29/2024 7:0553914  FALSE4PI001Complete1  
988/29/2024 7:0410317  FALSE3WC011 Side ARequested1  
788/29/2024 0:5953828  FALSE3FT005Requested3LateMark it late as the next entry is at 85 which is more than 5 mins
668/28/2024 15:1854245  FALSE4PI002Complete2  
658/28/2024 15:1354365  FALSE3PI002Requested2DeleteMark it delete since we have 66 even though its different users, could have been supervisor card
648/28/2024 15:1054098  FALSE4FT006Complete2  
638/28/2024 15:1054098  FALSE1FT006Pass2  
628/28/2024 15:1054098  FALSE3FT006Requested2  
608/28/2024 15:0953670  FALSE4WC004 Side BComplete2  
618/28/2024 15:0953955  FALSE4WC011 Side AComplete2  
598/28/2024 15:0953955  FALSE1WC011 Side APass2  
588/28/2024 15:0853670  FALSE1WC004 Side APass2  
578/28/2024 15:0853955  FALSE3WC011 Side ARequested2DeleteMark it delete since we have 59
568/28/2024 15:0754171  FALSE1WC008 Side APass2  
558/28/2024 15:0754171  FALSE4WC008 Side AComplete2  
548/28/2024 15:0753955  FALSE4WC011 Side BComplete2  
538/28/2024 15:0753955  FALSE1WC011 Side BPass2  
528/28/2024 15:0654171  FALSE3WC008 Side ARequested2DeleteMark it delete since we have 55
518/28/2024 15:0653670  FALSE4WC004 Side BComplete2  
508/28/2024 15:0654171  FALSE4WC008 Side BComplete2  
498/28/2024 15:0654171  FALSE1WC008 Side BPass2  
488/28/2024 15:0553955  FALSE3WC011 Side BRequested2DeleteMark it delete since we have 53
478/28/2024 15:0554370  FALSE4WC100 Side AComplete2  
468/28/2024 15:0554370  FALSE1WC100 Side APass2  
458/28/2024 15:0554370  FALSE3WC100 Side ARequested2DeleteMark it delete since we have 46
448/28/2024 15:0553670  FALSE1WC004 Side BPass2  
438/28/2024 15:0553712  FALSE1FT004Pass2  
428/28/2024 15:0553712  FALSE4FT004Complete2  
418/28/2024 15:0419722  FALSE4WC001Complete2  
408/28/2024 15:0453712  FALSE3FT004Requested2DeleteMark it delete since we have 42
398/28/2024 15:0454370  FALSE4WC100 Side BComplete2  
388/28/2024 15:0454370  FALSE1WC100 Side BPass2  
378/28/2024 15:0453988  FALSE1FT005Pass2  
368/28/2024 15:0453988  FALSE4FT005Complete2  
358/28/2024 15:0454171  FALSE3WC008 Side BRequested2LateMark it late since we do not have subsequent entry within 5 mins
348/28/2024 15:0353988  FALSE3FT005Requested2LateMark it late since we do not have subsequent entry within 5 mins
338/28/2024 15:0354370  FALSE3WC100 Side BRequested2LateMark it late since we do not have subsequent entry within 5 mins
328/28/2024 15:0219722  FALSE3WC001Requested2LateMark it late since we do not have subsequent entry within 5 mins
TheoC
Super User
Super User

Hi @lotus22 

 

I've done this in Power Query for you.

 

There are two tables in the attached PBIX.  One is filtered (with the > 5 mins remaining).  The other keeps both >5 mins and <5 mins in but I've added a validation column for you.

 

The approach I applied was:

 

  1. Create a new Custom Column to show the next entry with the same machine and operator.
  2. Calculated the time difference between the entries for the above.
  3. Filtered out entries with a time difference greater than 5 mins.

 

Let me know if you need this in DAX otherwise the PQ version is attached.  

 

Hope this helps! 🙂

 

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC  Thank you so much! That was quick.

 

We only need to validate if the previous entry is LATE and the next entry is on time. As soon as we get a Late entry for a particular machine, we must ensure another entry is on time within 5 minutes. If yes, then we delete the late entry; otherwise, it shows up.

 

For instance, if 158, a late entry, appears and we know that 159, a non-late entry, follows within 5 minutes, we can 'exclude' 158. Our focus is solely on validating late entries. 

 

It gets tricky. If RW100 Side A  has entry 158 that is late but there was no late entry, we include this on the graph. Now, after two hours, if RW100 Side A has another late entry, say 250, that will be a new validation but not part of 158.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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