Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Expiring date greater than "today"

Hi,

I am a brand new Power BI user.

Could you please help me create a measure to get as a result only expiration dates greater than "today"?

 

Thanks

  • Hi Anonymous,

     

    You could try this measure.

    ExpectedRes = CALCULATE(MAX('Table'[ExpDate]),FILTER('Table',MAX('Table'[ExpDate])>=TODAY()))

     

    Then, the result looks like this.

     

    Attached the pbix file as reference.

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

     

    Best Regards,    

    Community Support Team _ Caiyun

4 Replies

  • v-cazheng-msft's avatar
    v-cazheng-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous,

     

    You could try this measure.

    ExpectedRes = CALCULATE(MAX('Table'[ExpDate]),FILTER('Table',MAX('Table'[ExpDate])>=TODAY()))

     

    Then, the result looks like this.

     

    Attached the pbix file as reference.

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

     

    Best Regards,    

    Community Support Team _ Caiyun

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi there.

      Thank you, very much for your help.
      You suggestion worked very well!

       

      Best,

      Dielson

  • Anonymous ,

     

    countrows(filter(Table, Table[exp Date] > today() ) )

     

    or

     

    calculate(count(Table[Value]), filter(Table, Table[exp Date] > today() ) )

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi again.

    Thanks for your reply.

    Unfortunately, it is not working:

    I would like the results to show the all the product's expiration dates only when they are greater than "today".

     

    I tried your suggestioned solutions but I got no data as results. I might have used them in a wrong way.

     

    Eg.: if today is 08/10/2022 

    This is the matrix I would like to get:

    ProductExpDateExpected results in the column
    109/20/202709/20/2027
    201/08/202301/08/2023
    312/25/2020This row should not appear on the matrix
    404/12/202504/12/2025

     

    Could you give me a hint?