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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
TylerVono
Helper III
Helper III

Count Latest Date in an Aggregated table of purchase orders based with Unique shipments - Question

Hello, I am trying to count just the latest date of a column in a aggregated pool of purchase orders. Every day we take a snapshot of the purchase order's current conditions, at time the buyers change the promised date based on the suppliers best date.

 

I'd like to record the current days 'Past Due', however there are multiple changes of the date column which compounds the data, makingit pile up and unable to calculate distinct unique shipment dates.

 

Chat GPT doesnt seem to help me... wondering if the Power BI community has any good workarounds. Keep in mind I am doing a DirectQuery from a coworkers database so Date/Time control will not be in my favor.

 

Here is an example, i.e. PO# 1144900, Line 2 and Shipment 1 is repeated 4 times, technically I just want to record it as 1 single occurance as a past due. You can see the date change, but I simple want it to be at its LATEST date.

 

Thoughts, Ideas? I appreciate any advice here.

 

TylerVono_0-1691887247451.png

 

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

Share sample data of a few PO's in a format that can be pasted in an MS Excel file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hey Ashish, Can you let me know if you've got any help or suggestions for me? Thanks for looking into this!

Hi,

I have not understood your requirement.  For the table that you have shared, show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for your patience Ashish, Ok so here is a example below:

 

This purchase order is repeated twice, the only difference is the date column called the "First Promised Date". I would like to just count the latest date a single time, currently this purchase order is being counted twice due to my inaccurate measure. I just want to record it as one single occurance . You can see the date change, but I simple want it to be at its LATEST date visible, i.e. 11/20/2023 MAX not 6/19/2023.

 

 

 

Supplier

PO NumberItem NumberLineShipmentProduct LineUnique ShipmentFirst Promise Date
KIRSH FOUNDRY INC1141140S-90988 RAW11PMG1141140116/19/2023 0:00
KIRSH FOUNDRY INC1141140S-90988 RAW11PMG11411401111/20/2023 0:00

I'll try once again - "For the table that you have shared, show the expected result"


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

TylerVono_0-1692376288241.png

 

Hi,

This M code works

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Supplier", type text}, {"PO#", Int64.Type}, {"Item #", type text}, {"Line", Int64.Type}, {"Shipment", Int64.Type}, {"Product Line", type text}, {"Unique shipment", Int64.Type}, {"First promise date", type datetime}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Supplier", "PO#", "Item #", "Line", "Shipment", "Product Line", "Unique shipment"}, {{"Count", each Table.Max(_,"First promise date")}}),
    #"Expanded Count" = Table.ExpandRecordColumn(#"Grouped Rows", "Count", {"First promise date"}, {"First promise date"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Expanded Count",{{"First promise date", type date}})
in
    #"Changed Type1"

Hope this helps.

Ashish_Mathur_0-1692400870718.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hey Ashish, So the problem is I cannot access the Power Query Editor since I am pulling this table via DirectQuery. Do you know any measures or custom column that can be used as a workaround?

 

TylerVono_0-1692622333623.png

 

Hello Ashish - Thank you so much for your help, here is an example ... I appreciate any help you can provide.

 

 

Supplier

Count of BuyerPO NumberItem NumberLineShipmentProduct LineUnique ShipmentFirst Promise Date
SIGNICAST CORP11127031FD-433011VACUFUSE II1127031114/3/2023 0:00
SIGNICAST CORP11127036FD-433411VACUFUSE II1127036116/2/2023 0:00
SIGNICAST CORP11127038FD-432911VACUFUSE II1127038116/13/2013 0:00
SIGNICAST CORP11129908SD-616911N/A1129908116/26/2023 0:00
APLICACIONES INDUSTRIALES DE CALIDAD SA DE CV11136111F-1026411HOLDERS1136111113/9/2023 0:00
APLICACIONES INDUSTRIALES DE CALIDAD SA DE CV11136111F-1026411HOLDERS1136111115/2/2023 0:00
ASCHER BROTHERS11136645QG-159023311N/A1136645115/5/2023 0:00
KIRSH FOUNDRY INC11141140S-90988 RAW11PMG1141140116/19/2023 0:00
KIRSH FOUNDRY INC11141140S-90988 RAW11PMG11411401111/20/2023 0:00
NAMEPLATE & PANEL TECHNOLOGY11144900G-961521N/A1144900218/3/2023 0:00
NAMEPLATE & PANEL TECHNOLOGY11144900G-961521N/A1144900218/8/2023 0:00
NAMEPLATE & PANEL TECHNOLOGY11144900G-961521N/A1144900218/15/2023 0:00
NAMEPLATE & PANEL TECHNOLOGY11144900G-961521N/A1144900218/17/2023 0:00
H3 MANUFACTURING GROUP LLC11146571CA-24011PMG11465711110/31/2022 0:00
PRECISION ENTERPRISES INC11146811SD-679011N/A1146811117/19/2023 0:00
NEP ELECTRONICS INC11147295FD-341131TRIPSAVER II11472953111/1/2023 0:00
NEP ELECTRONICS INC11147295FD-341131TRIPSAVER II11472953112/19/2023 0:00
NEP ELECTRONICS INC11147295FD-341131TRIPSAVER II1147295311/11/2024 0:00
BISON GEAR AND ENGINEERING CO11147416SD-578514PMG11474161411/6/2023 0:00
BISON GEAR AND ENGINEERING CO11147416SD-578514PMG11474161411/14/2023 0:00
BISON GEAR AND ENGINEERING CO11147416SD-578514PMG1147416141/8/2024 0:00
BISON GEAR AND ENGINEERING CO11147416SD-578515PMG11474161511/29/2023 0:00
BISON GEAR AND ENGINEERING CO11147416SD-578515PMG11474161512/11/2023 0:00
BISON GEAR AND ENGINEERING CO11147416SD-578515PMG1147416151/26/2024 0:00

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.