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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Ajaikumar
Regular Visitor

DAX is not identifying the date fields

I'm trying to get the number of days between two dates. For that, I tried to use the DATEDIFF function but the date fields are not showing up in IntelliSense and if I try to enter it manually it shows an error that is in the figure below:

Screenshot 2023-01-08 231842.png

 

Please let me know what is wrong with this expression. Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Ajaikumar ,

As checked your screenshot, what you are trying to create is a measure. That is the cause of problem. This errror 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. You can review the following blog for more details.

DAX error messages in Power BI

yingyinr_0-1673331764653.png

And the solution is that you can create a calculated column as below to replace this measure...

 

R value = DATEDIFF ( calendar[Date], TODAY (), DAY )

 

yingyinr_1-1673332092675.png

In addition, you can refer the following blog to get the difference between two dates.

Power bi Date Difference

yingyinr_1-1673332705332.png

Best Regards

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Ajaikumar ,

As checked your screenshot, what you are trying to create is a measure. That is the cause of problem. This errror 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. You can review the following blog for more details.

DAX error messages in Power BI

yingyinr_0-1673331764653.png

And the solution is that you can create a calculated column as below to replace this measure...

 

R value = DATEDIFF ( calendar[Date], TODAY (), DAY )

 

yingyinr_1-1673332092675.png

In addition, you can refer the following blog to get the difference between two dates.

Power bi Date Difference

yingyinr_1-1673332705332.png

Best Regards

Thank you for the solution @Anonymous 

tamerj1
Super User
Super User

Hi @Ajaikumar 

perhaps you're trying to create a new Calculated Column but in fact you created a Measure instead

Helpful resources

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

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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