cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
forever
Frequent Visitor

Error with New Measure with DATEDIFF()

Hi. I am trying to new Measure with DATEDIFF. 

Example that I expected:

image.png

 

My stitution:

image (1).png

I guess the problem is table name and column name are written in Chinese. 

Table Name: COPTD-FT-客戶訂單單身資料檔

Column Names:  預交日 & 原預交日

These two columns type are Date.

 

Can anyone tell me how to deal with this problem? Thanks!

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @forever ,

 

The problem is not in the Chinese name. The problem lies in the measure you use. If you use the measure, you need to add MAX/MIN here to determine the row of your column name.

Screenshot 2021-06-21 101149.png

 

If you are adding a calculated column, you do not need to use MAX/MIN, as shown below.

Screenshot 2021-06-21 101312.png

 

The difference is the context of evaluation. A measure is evaluated in the context of the cell evaluated in a report or in a DAX query, whereas a calculated column is computed at the row level within the table it belongs to.

Reference: measure vs calculated column

 

Best Regards,

Stephen Tao

 

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

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @forever ,

 

The problem is not in the Chinese name. The problem lies in the measure you use. If you use the measure, you need to add MAX/MIN here to determine the row of your column name.

Screenshot 2021-06-21 101149.png

 

If you are adding a calculated column, you do not need to use MAX/MIN, as shown below.

Screenshot 2021-06-21 101312.png

 

The difference is the context of evaluation. A measure is evaluated in the context of the cell evaluated in a report or in a DAX query, whereas a calculated column is computed at the row level within the table it belongs to.

Reference: measure vs calculated column

 

Best Regards,

Stephen Tao

 

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

ryan_mayu
Super User
Super User

@forever 

I think your column name displayed wrongly in your formula. maybe try to remove extra single qutotation marks.

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Power BI Womens Summit 2021 768 x460.jpg

Interviews, learning sessions, allies, and more!

#PowerBIWomenSummit

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!