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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Philipp_ISARTAX
Frequent Visitor

Max Date filtered by a specific criteria/ID

Hello all,

I'va a problem receiving a result for a date. Here is the table-strucutre:

 

Table Name 'Invoices':

Invoice-DateProductPurchase Order (PO)Latest Invoice-Date for PO
01.12.2023XA 
05.12.2023XB 
06.01.2024YA 
08.05.2022ZC 
01.12.2023XB 
08.09.2023ZA 

 

My DAX-Try for the Column Latest Invoice Date for PO was as follows:

Latest Invoice-Date for PO = CALCULATE(Max('Invoices' [Invoice-Date]);Filter('Invoices';'Invoices'[Purchase Order (PO)]='Invoices'[Purchase Order (PO)]))

 

The Dax provides the following Values:

 

Invoice-DateProductPurchase Order (PO)Latest Invoice-Date for PO
01.12.2023XA06.01.2024
05.12.2023XB06.01.2024
06.01.2024YA06.01.2024
08.05.2022ZC06.01.2024
01.12.2023XB06.01.2024
08.09.2023ZA06.01.2024

 

I would expect the following Values:

Invoice-DateProductPurchase Order (PO)Latest Invoice-Date for PO
01.12.2023XA06.01.2024
05.12.2023XB05.12.2023
06.01.2024YA06.01.2024
08.05.2022ZC08.05.2022
01.12.2023XB05.12.2023
08.09.2023ZA06.01.2024

 

Any Idea, how to adjust the Dax formula to receive the expected values?

 

Kind regards

1 ACCEPTED SOLUTION
some_bih
Super User
Super User

Hi @Philipp_ISARTAX possible solution, create measure as following

LatestInvoiceDate =
CALCULATE(
    MAX('Invoices_new'[Invoice_Date]),
    ALLEXCEPT('Invoices_new','Invoices_new'[PurchaseOrdrDate])
)
Adjust column and table names,
some_bih_0-1705492483722.png

 

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






View solution in original post

1 REPLY 1
some_bih
Super User
Super User

Hi @Philipp_ISARTAX possible solution, create measure as following

LatestInvoiceDate =
CALCULATE(
    MAX('Invoices_new'[Invoice_Date]),
    ALLEXCEPT('Invoices_new','Invoices_new'[PurchaseOrdrDate])
)
Adjust column and table names,
some_bih_0-1705492483722.png

 

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.