Forum Discussion
andi2333
Helper I
2 years agoError with simple DAX query
Hello, I am not sure whats going wrong here since this seems a very simple topic. I have an excel table with approx 7000 entries showing log errors on a daily basis, so e.g. Date | Error 01....
- 2 years ago
Hi andi2333 -Your DAX query is almost correct, but the issue lies in how you're trying to filter the data to only count errors on the last date
please use the below
VAR_LastDate = MAX('LogErrors'[Date])
VAR_LogErrorsLastDay = CALCULATE(
COUNT('LogErrors'[Error]),
'LogErrors'[Date] = VAR_LastDate
)
RETURN VAR_LogErrorsLastDayHope it works.
rajendraongole1
Super User
2 years agoHi andi2333 -Your DAX query is almost correct, but the issue lies in how you're trying to filter the data to only count errors on the last date
please use the below
VAR_LastDate = MAX('LogErrors'[Date])
VAR_LogErrorsLastDay = CALCULATE(
COUNT('LogErrors'[Error]),
'LogErrors'[Date] = VAR_LastDate
)
RETURN VAR_LogErrorsLastDay
Hope it works.