Forum Discussion
calculations with Date fields
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
- PhilipTreacySuper User
Hi Anonymous
No worries.
That's the way the DATE function accepts its parameters.
https://docs.microsoft.com/en-us/dax/date-function-dax
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. - HotChilliCommunity Champion
"1/1/2020" is text. Use the DATE syntax
- PhilipTreacySuper User
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.- AnonymousNot 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