Forum Discussion
Date Difference excluding weekends
Anonymous
Here SLA is measure !
Can you fix this error:
Logical expressions that are added to CALCULATE() must be of the format Table[Column] = static expression.
If you want to do a more advanced logical expression, such as the following:
Table[Column] = [Measure]
[Measure] = static expression
[Measure] = [another Measure]
then you need to use FILTER() inside of CALCULATE()
Something like this:
[Count of SLA] =
CALCULATE (
DISTINCTCOUNT ( Dates[CreateDt].[Date] ),
FILTER (
VALUES(Dates[CreateDt]),
[SLA] = "Met SLA"
)
)The FILTER() parameter says this:
"Look at the distinct list of dates in the CreateDt column, based on the current filter context (as determined by slicers, etc.) Go through that list line by line and evaluate the [SLA] measure. Only keep those dates where [SLA] = "Met SLA"
Now you have a (likely) smaller list of values from the Dates[CreateDt] column. That is the additional filter that is taken into account when CALCULATE performs the calculation...in this case counting the distinct number of values in the Dates[CreateDt] column.
- ssvr8 years agoHelper III
Anonymous
Thanks ChrisHaas.
Its working great.
Can you fix the DateDiff excluding weekends DAX also