Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

calculations with Date fields

Q1 = CALCULATE(count(Campaigns[id]), Campaigns[startDate] >= "1/1/2020", Campaigns[startDate] <= "3/30/2020"
 
This returns an error - does not support comparing values of type DATE with values of type TEXT.  What do I need to do to make this measure work? I tried using SelectedValue, but it didn't work. 
 
Thanks in advance! 
Jim
  • Anonymous 

    Like this

     

    Q1 = CALCULATE(count(Campaigns[id]), Campaigns[startDate] >= DATE(2020,1,1), Campaigns[startDate] <= DATE(2020,3,30)

     

    Regards

    Phil 


    If I answered your question please mark my post as the solution.
    If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.

4 Replies

  • Anonymous 

    Like this

     

    Q1 = CALCULATE(count(Campaigns[id]), Campaigns[startDate] >= DATE(2020,1,1), Campaigns[startDate] <= DATE(2020,3,30)

     

    Regards

    Phil 


    If I answered your question please mark my post as the solution.
    If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Phil! - that worked - what determines the syntax for the date ie: yyyy,mm,dd ? In the table its formatted as mm,dd,yyy. 

       

      Jim