Forum Discussion

7 Replies

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

    Hi Anonymous ,

     

    To create a meausre using TODAY function.

    Measure = CALCULATE(SUM('Table 2'[value]),FILTER('Table 2','Table 2'[Date] = TODAY()))

     

    For more details, please check the pbix as attached. If it doesn't meet your requirement, kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      v-frfei-msft  Thanks for your reply!

      I will try to explain my question more clearly.

      I have a table that has columns ValidFromDate, EndDate, ResultID, and ResulType.
      I want to filter the table by today's date, and today's value must be
      Today >= ValidFromDate & Today<= EndDate.

      For example, In SQL we can use the query

      case when getdate() >= ValidFromDate and GETDATE() <= EndDate then 1 else 0 end as active

       

      Is there a way to do that in Power BI?

      Regards,

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you a lot, that was jexactly what i was looking for

  • You need to have some date on which you want to filter the Today's value. What do you mean by Today's value without a date?