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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
rickylee
Helper III
Helper III

Error when using datediff function in measure

Hello,

I have two columns and are filled with dates. Some of them a empty. I tried to use datediff function to find the difference between two dates. 
E.g.
The time it takes to start filling in an application = DATEDIFF('gdit_assessments'[chas_datestarted],'gdit_assessments'[chas_dateentered],DAY)

 

But, I got an error message says "A single value for column 'chas_datestarted' in table 'gdit_assessments' 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."

 

Does anyone know why?

Thanks,
Ricky

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

@rickylee,

Since you are using a measure, you need to aggregate your columns (MAX, MIN). In your case, it is better to use a calculated column instead.

 

View solution in original post

v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @rickylee,

As @Anonymous said, please create a calculated column rather than a measure in your scenario, please get more details form this article: calculated-columns-and-measures-in-dax.

Thanks,
Angelia

View solution in original post

2 REPLIES 2
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @rickylee,

As @Anonymous said, please create a calculated column rather than a measure in your scenario, please get more details form this article: calculated-columns-and-measures-in-dax.

Thanks,
Angelia

Anonymous
Not applicable

@rickylee,

Since you are using a measure, you need to aggregate your columns (MAX, MIN). In your case, it is better to use a calculated column instead.

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.