0
votes

I try to get a very simple count that checks for today's year. DIM_Project.StartDate is of type DATE and there are multiple records %ProjKey with a StartDate within the year 2019.

Any idea why I get no results at all with the following DAX formula, only data within the same table:

ProjectCount = 
CALCULATE(
    COUNT(DIM_Project[%ProjKey]),
    DIM_Project[Startdate] = YEAR(TODAY()))

Anything I miss here?

1

1 Answers

2
votes

Comparing date (DIM_Project[Startdate]) with integer (value returned by YEAR() function) doesn't seems right. What about this code?

ProjectCount = 
CALCULATE(
    COUNT(DIM_Project[%ProjKey]),
    YEAR(DIM_Project[Startdate]) = YEAR(TODAY()))