This is probably pretty basic stuff, but I'm new to DAX and it's got me stumped.
This measure works for finding our most recent record:
MaxCompDt:=CALCULATE(LASTDATE(Completed[Completion Date]),all(Completed))
And this measure works for finding the first day of whatever month that record is from:
1stDOM:=CALCULATE(STARTOFMONTH(LASTDATE(Completed[Completion Date])),all(Completed))
But if I try to use the first measure inside the second measure to replace the LASTDATE part:
1stDOM:=CALCULATE(STARTOFMONTH([MaxCompDt]),all(Completed))
Then I get the "CALCULATE has been used in a true/false expression" error. The two working measures are being used for a DATESBETWEEN calculation, which is working. So really everything works. This is just more a curiosity so that I can learn something.
So I have two questions.
1. Why does this trigger that error?
2. What is best practice here? Should I use the first measure inside the second measure, or is that not a good idea?
This measure works for finding our most recent record:
MaxCompDt:=CALCULATE(LASTDATE(Completed[Completion Date]),all(Completed))
And this measure works for finding the first day of whatever month that record is from:
1stDOM:=CALCULATE(STARTOFMONTH(LASTDATE(Completed[Completion Date])),all(Completed))
But if I try to use the first measure inside the second measure to replace the LASTDATE part:
1stDOM:=CALCULATE(STARTOFMONTH([MaxCompDt]),all(Completed))
Then I get the "CALCULATE has been used in a true/false expression" error. The two working measures are being used for a DATESBETWEEN calculation, which is working. So really everything works. This is just more a curiosity so that I can learn something.
So I have two questions.
1. Why does this trigger that error?
2. What is best practice here? Should I use the first measure inside the second measure, or is that not a good idea?