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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.