Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Select the first value by date

Hello!

 

How can I via a measure get the oldest value by date in a table like this?

 

 

Tried FIRSTDATE, LASTEDATE and EARLIEST but it returns first 2021-01-01.

 

Kind Regards,

Anthon

 

2 Replies

  • Hi, Anonymous 

    It is quite difficult for me to understand the cause of having the above result without seeing your data model.

    Please try to use MIN function in your measure.

    Or, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.

     

    Hi, My name is Jihwan Kim.

     

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

     

    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM

  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi Anonymous 

    The type of your column is Date/time, however, the type of argument that FIRSTDATE() accepts is Date.

    FYI:

    https://dax.guide/firstdate/

    https://dax.guide/earliest/

     

    Besides, you can use the function MIN() mentioned by Jihwan_Kim. 

     

    Best Regards,

    Community Support Team _ Tang

    If this post helps, please consider Accept it as the solution to help the other members find it more quickly.