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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DAX Syntax Error

Hi, 

 

So i'm having an issue with getting this syntax to work, i'm entirely new to DAX language and am unsure of how to get the request to work correctly. 

 

What I am hoping to get out of the syntax is a measure which provides a total difference between two sets of dates. Which I can then use to determine how long a process stage takes to complete for each participant involved. I expect there probably is an easier way to create the data but I'm attempting to use the below formula:

 

Diff = DATEDIFF(Table1[Date1];Table1[Date2];DAY)

 

However, my main issue is that I would like to use two fields 'Submission Date' and 'Approval Date' to measure the length of time it takes to complete the process stage. I don't think that's feasible with the above expression. Is there an alternative solution? 

 

Example Data

 

Company AMarket Re-assurance Information Return 11/07/201721/08/2017
Company AMarket Re-assurance Plan14/08/201721/08/2017
Company AMarket and Interface Training  
Company ABusiness Solution Assessment / Self-Certification Declaration  
Company AMarket Entry Assurance Testing18/09/201706/10/2017
Company BMarket Re-assurance Information Return 12/07/201727/07/2017
Company BMarket Re-assurance Plan18/07/201727/07/2017
Company BMarket and Interface Training  
Company BBusiness Solutions Assessment28/07/201721/08/2017
Company BMarket Entry Assurance Testing21/08/201717/09/2017

 

Thank you for the advice/help!!

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

 

copying your sample data to a Power BI Table "Enter Data", and wachting this table in the Query Editor, I realized that Power BI does not automatically "recognizes" the content of the columns "Date1" and "Date2". The have to be empty and not containing a space.

 

The empty cells are not empty but contain a single space, I'm not sure if this has happened by pasting the table into your post but is already present in you orignial data, this would explain why your DAX formula won't work as you would expect.

 

This is just some guesswork because you did not mention what kind of error message you received.

 

Hopefully this will help you to resolve your problem.

 

Regards

Tom 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
jthomson
Solution Sage
Solution Sage

I'd use the query editor instead and just take one column away from the other (making the resulting column an integer if needed)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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