Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
So I am familiar with the datediff command, but I have some cells in my time columns that are N/A because we did not measure those times. I am trying to use the datediff command to calculate the difference in times between two columns, but I can't do so because not all of the cells in the column have a time in them. How do I get around this?
Update:
Here is my DAX code:
Column = IF('Time Log'[Start Time] = "N/A", "N/A", DATEDIFF('Time Log'[Start Time],'Time Log'[End Time], minute))
I am getting the following error: Expressions that yield variant data-type cannot be used to define calculated columns.
How do I fix this?
"N/A" is text and DATEDIFF returns a number. You need the two return values to agree in type. I would just return null for N/A
Column = IF('Time Log'[Start Time] = "N/A", BLANK(), DATEDIFF('Time Log'[Start Time],'Time Log'[End Time], minute))
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
147 | |
85 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |