Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

count names on a specific day

 

I want to count the names on a chosen day from date table.

 

Measure=

var a=selectvalue('date'[date])

return

calculate(count(names),a>startdate&&a<enddate)

 
 

The error message is

The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.

What did I do wrong?

 

 

  • You need to use a filter in your second statement of the calculate expression.

    calculate(count(names),filter(table, a>startdate&&a<enddate))

    If this answered your question, please mark it as the solution. Kudos are welcome! 🙂

1 Reply

  • JarroVGIT's avatar
    JarroVGIT
    Resident Rockstar
    You need to use a filter in your second statement of the calculate expression.

    calculate(count(names),filter(table, a>startdate&&a<enddate))

    If this answered your question, please mark it as the solution. Kudos are welcome! 🙂