Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jimbob2285
Advocate II
Advocate II

Calculate(Count(), Filter()) - A single value cannot be determined

Hi

 

I'm hoping that someone cleverer than me can help please, as this is something that I come up against time and time again, and I don't really understand why... I often get the error message "A single value for column 'Date' in table 'Calendar' cannot be determined" when trying to calculate ratios (percentages) as a Measure, rather than a Column, so that it can be aggregated, if that's the right word, I mean so that I can show the ratio by month, rather than just date

 

In this example, I've got:

  • A table of projects that we've quoted (with a quoted date)
  • A second table of projects that we've won (with a won date), With the following measure formula, that throws up the above error:
  • A calendar table, calculated from the min and max dates of the other two tables

 

In the Calendar table I'm trying to run the following measure, but keep getting the above eror: 

WinRate =
VAR ProjectsWon = CALCULATE(
    COUNT(Won[ID]),
    FILTER(Won, Won[Date] = 'Calendar'[Date])
)
VAR ProjectsQuoted = CALCULATE(
    COUNT(Quoted[ID]),
    FILTER(Quoted, Quoted[Date] = 'Calendar'[Date])
)
RETURN DIVIDE(SUM('Calendar'[ProjectsWon]), SUM('Calendar'[ProjectsQuoted]))
 
But I'm getting the error: "A single value for column 'Date' in table 'Calendar' cannot be determined"
 
I can do the counts as columns in the Calendar table and then calculate the WinRate as a measure, so why can't I do it all in a single measure, to negate the need for the helper columns?
 
There are only unique dates in the 'Calendar'[Date] field, so it seems as though the error message is wrong, but I must be missing something
 
Can anyone please advise what I'm doing wrong?
 
Thanks
Jim
1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

It is an issue of context. 
As a measure, the formula you have written does not know what to do with the 'Calendar'[Date]'. That is why it suggests SUM, MAX etc.

I have been able to solve this usually by using the SELECTEDVALUE() function. In your case it would look like;

FILTER(WonWon[Date] = SELECTEDVALUE('Calendar'[Date]))

If you wrote your initial formula as a calculated column it would work as written as the row of the table would immediately provide the context for the 'Calendar'[Date] value.

Hope this helps a bit.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
jgeddes
Super User
Super User

It is an issue of context. 
As a measure, the formula you have written does not know what to do with the 'Calendar'[Date]'. That is why it suggests SUM, MAX etc.

I have been able to solve this usually by using the SELECTEDVALUE() function. In your case it would look like;

FILTER(WonWon[Date] = SELECTEDVALUE('Calendar'[Date]))

If you wrote your initial formula as a calculated column it would work as written as the row of the table would immediately provide the context for the 'Calendar'[Date] value.

Hope this helps a bit.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





That worked a treat, thanks for that

 

Everyday's a school day

 

Cheers

Jim

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.