cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
eric98
Helper II
Helper II

Find two different last date in the same column

Hello everyone.

I'm facing an issue and you may help me with that.

As you will see in the table below, I have four columns : invoice_number, invoice_date, customer_number, customer_machine_number.

The customer_machine number is a nullable column.

I notice that when I make a search the last date of the column invoice_date in this table, if the customer_number is not null and the customer_machine_number is null, I find one last date.

But if the customer_number and the customer_machine_number are both not null, I find another last date.

I would like to show the two different last date in a matrice table but I don't know how to do it.

Anyone ?

 

invoice_numbercustomer_numbercustomer_machine_numberinvoice_date
78768751234561236781/1/2021
7786875123456 1/1/2021
70968751234561236781/1/2021
7456875123456 1/1/2021
7026875123456 1/1/2021
79468751234561236782/1/2021
7086875123456 1/1/2021
78791051234561236782/1/2021
7870375123456 1/1/2021
7870R15123456 1/1/2021
78015Z51234561236782/1/2021

 

invoice_numbercustomer_numbercustomer_machine_numberlast_date(invoice_date)
78015Q51234561236782/1/2021

 

invoice_numbercustomer_numbercustomer_machine_numberlast_date(invoice_date)
78015Q5123456 1/1/2021

 

 

 

1 ACCEPTED SOLUTION
eric98
Helper II
Helper II

I finally solve the problem with this measure : 

Date1 = CALCULATE( MAX([INVOICE_DATE]), FILTER(INVOICE_TABLE, AND(CUSTOMER_NUMBER <> BLANK(), MACHINE_NUMBER <> BLANK())))
And for the second date, just do Date2 = MAX(INVOICE_DATE)

View solution in original post

5 REPLIES 5
eric98
Helper II
Helper II

I finally solve the problem with this measure : 

Date1 = CALCULATE( MAX([INVOICE_DATE]), FILTER(INVOICE_TABLE, AND(CUSTOMER_NUMBER <> BLANK(), MACHINE_NUMBER <> BLANK())))
And for the second date, just do Date2 = MAX(INVOICE_DATE)
mh2587
Impactful Individual
Impactful Individual

measure 1 =  // where machine and customer number not null

CALCULATE(MIN(Table[Invoice Date]),AND('Table'[Customer_Number] <> BLANK(),'Table'[Machine_Number] <> BLANK())
measure 2 = MIN(Table[Invoice Date])


Muhammad Hasnain

#LetsConnect https://www.linkedin.com/in/hasnain2587/

Hello !

Thank for your help, but this measures doesn't work...

I found the good date for the measure 2 but not for the measure 1

mh2587
Impactful Individual
Impactful Individual

try max in place MIN hope this will give you the output 



Muhammad Hasnain

#LetsConnect https://www.linkedin.com/in/hasnain2587/

I've already try that with MAX!

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors