Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Need help in DAX

Experts, please help me to fix the below DAX code. I am trying to compare/equal to date passing from create data with todays date, it is throwing the error. pls help

 

 

  • Nathaniel_C's avatar
    Nathaniel_C
    3 years ago

    Hi Anonymous ,
    If what you are trying to do is to filter out today's date,  drop the measure in the filter pane for this visual as in the picture below. = N will get you every date but today, Y will get you only today.


    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
    Nathaniel

5 Replies

  • Nathaniel_C's avatar
    Nathaniel_C
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous ,

    Try this please:

    Date compare = IF(MAX(compare[Date]) = TODAY(), "Y", "N")

     


    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
    Nathaniel

    • Nathaniel_C's avatar
      Nathaniel_C
      Icon for Community Champion rankCommunity Champion

      Hi Anonymous 


      Let me know if you have any questions.

      If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
      Nathaniel

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Nathaniel_C for your quick reply, unfortunately your code is not helping to get the Max date. I don't understand why my date is not getting the MAX date from the Date column. pls help. It should filtered out 01/15/23.

       

       

       

      • Nathaniel_C's avatar
        Nathaniel_C
        Icon for Community Champion rankCommunity Champion

        Hi Anonymous ,
        What are you trying to do? When I read your first post, my understanding is that you wanted to compare each create date and compare it to today's date.  If it matches, mark it Y in a new column, or if it does not, mark it N.  Which is what I did.  If that is not what you are looking for, please give us a visual for your expected results.  You can dummy this up in Excel if you need to do so.


        Let me know if you have any questions.

        If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
        Nathaniel