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

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

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors