Forum Discussion

NBOnecall's avatar
NBOnecall
Helper V
7 years ago
Solved

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...
  • MFelix's avatar
    7 years ago

    Hi NBOnecall ,

     

    Try the following measure:

     

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

    Regards,

    MFelix