locked
A single calue for column cannot be determined RRS feed

  • Question

  • The following measure:

    WorkDaysCurrentMonth = COUNTROWS('Date'[Date])

    gets the following error:

    A single value for column 'Date' in table 'Date' cannot be determined.  This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum, to get a single result.

    Isn't COUNTROWS() an aggregation just like  COUNT()?

    What am I missing here?

    Thursday, July 7, 2016 11:16 PM

Answers

  • CountRows counts the rows in table. In your expression 'Date'[Date] is a column. If you've just got 1 row per date the following would work.

    =COUNTROWS('Date')

    Or you can use the VALUES() function to convert the column reference into a single column table

    =COUNTROWS( VALUES('Date'[Date] ) )


    http://darren.gosbell.com - please mark correct answers

    Friday, July 8, 2016 5:25 AM

All replies

  • CountRows counts the rows in table. In your expression 'Date'[Date] is a column. If you've just got 1 row per date the following would work.

    =COUNTROWS('Date')

    Or you can use the VALUES() function to convert the column reference into a single column table

    =COUNTROWS( VALUES('Date'[Date] ) )


    http://darren.gosbell.com - please mark correct answers

    Friday, July 8, 2016 5:25 AM
  • Thanx.  That does it.  Another little wrinkle in PBI. 
    Monday, July 11, 2016 3:21 PM