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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
NBOnecall
Helper V
Helper V

Measure to find earliest date in a DirectQuery

Hi,

I am trying to create a measure to find the earliest date where the quantity is <> 0. Below is the example, lets call the table InventoryActivity. The data I am combing through is a direct query, so I can't create a calculated column.

 

Capture.JPG

 

My Expected results would be EarliestDate = 2/3/2019.

 

Thank you,

Noel

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @NBOnecall ,

 

Try the following measure:

 

First date =
CALCULATE (
    FIRSTNONBLANK ( 'Table'[Date]; 0 );
    FILTER ( ALL ( 'Table'[Quantity] ); 'Table'[Quantity] <> 0 )
)

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @NBOnecall ,

 

Try the following measure:

 

First date =
CALCULATE (
    FIRSTNONBLANK ( 'Table'[Date]; 0 );
    FILTER ( ALL ( 'Table'[Quantity] ); 'Table'[Quantity] <> 0 )
)

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors