Calculated Column for Dates

Hello EDNA Forum Good Day!

What I’m trying to accomplish:

sample .pbix attached.

Using the Diff Function, I trying to created a calculated column between the two dates below;

signup_dt and the frst_vst_dt.

I can’t seem to get my Diff Function to work.

Note: I my production .pbix I having an issue with converting the frst_vst_dt from a text to a date.

Here is the error message

image

In this column I have missing data - null and errors, for the frst_vst_dt has not happen yet.

To create the sample .pbix, I exported the data out then uploaded it into a new .pbix. Currently I’m not have an issue with changing the frst_vst_dt column from text to a date.

Please advise if you have any questions

Thank you

Per the attached .pbix

Sample Data for Calculated Columns.pbix (1.3 MB)

Also, in Query Editor I tried to change the Locale for that column to see if it work, no luck.

Here is the error from Query Editor

[DataFormat.Error] We couldn’t parse the input provided as a Date value.
image

Hi @ambidextrousmentally

It seems to work ok for me? Please find attached.

Diff in Dates =
DATEDIFF(
    MAX( 'Sample Data'[signup_dt] ),
    MAX( 'Sample Data'[frst_vst_dt] ),
    DAY
)

Sample Data for Calculated Columns.pbix (1.3 MB)

Hi @ambidextrousmentally, did the response provided by @jamie.bryan help in solving your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query.