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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors