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
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
Super User
Super User

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])

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



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

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


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



I've already try that with MAX!

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.

Top Solution Authors