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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.