Forum Discussion

EWBWEBB's avatar
EWBWEBB
Icon for Helper III rankHelper III
3 years ago
Solved

USERELATIONSHIP ERROR - breaking results

I am trying to count the number of cases closed and logged in a date range using a DimDate calendar in my slicer.   DimDate is a Simple calendar table Date,DateKey,Day,Month,Year   I then have a...
  • Uspace87's avatar
    3 years ago

    Try this one:

    VAR MinDate = MIN(Central_Tracker[DateClosedKey])
    VAR MaxDate = MAX(Central_Tracker[DateClosedKey])
    
    VAR Result = 
    
    CALCULATE(
        COUNTROWS(Central_Tracker),
        USERELATIONSHIP(Central_Tracker[DateClosedKey],DimDate[DateKey]),
        FILTER(DimDate,
            DimDate[DateKey] >= MinDate &&
            DimDate[DateKey] <= MaxDate
        )
    )
    
    RETURN
    Result