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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
shaima97
Frequent Visitor

DATEDIFF not recognizing a column

Hello everyone , 

 

im trying to calculate the probation period of the employees

the probation period is the employees that their haring date is 3 months or less.   

 

i have a "hiring_date" column , and im geeting my table data from sql server . 

 

i used to do this dax fourmula with other projects that have data from an excel sheet , but its not working with my new project ,

 

this my old project the data is from an excel sheet :

p.png

 when i do it with my new project it show me this error :

Picture2.png

 

 

i need help please . 

thank you 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @shaima97 

 

You can try the following methods.
Column:

Column = DATEDIFF([Hiring_date],TODAY(),MONTH)

Measure:

Measure = DATEDIFF(SELECTEDVALUE('Table'[Hiring_date]),TODAY(),MONTH)

vzhangti_0-1672195189781.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi, 

 

If there are two values in the hiring_date column that are the same, the measure will only return a value for one of them, How do we update the formula so it brings back values for all?

 

Thanks 

v-zhangti
Community Support
Community Support

Hi, @shaima97 

 

You can try the following methods.
Column:

Column = DATEDIFF([Hiring_date],TODAY(),MONTH)

Measure:

Measure = DATEDIFF(SELECTEDVALUE('Table'[Hiring_date]),TODAY(),MONTH)

vzhangti_0-1672195189781.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Super User
Super User

@shaima97 In your image, I do not see any other columns in your table.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
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.