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.
this is the error i am getting when i create a column AFELeeway.
Seems like you are mixing M syntax with DAX syntax. They are two different languages. See this article:
https://community.powerbi.com/t5/Community-Blog/The-Languages-of-Power-BI/ba-p/69104
DAX IF syntax is exactly like Excel IF syntax.
IF(<condition>, <true>, <false>)
M syntax is:
if <condition> then <true> else <false>
still error is coming.Error is coming near is date.How to solve it.
"is" is not valid syntax for either DAX or M, you need to use =
I am getting error as below:
Failed to resolve name 'date'. It is not a valid table, variable, or function name.
And my code is :
AFELeeway = if((Query1[FullAfeApproved] = date),(DATEDIFF(Query1[FullAfeApproved],Query1[EstimatedSpud],DAY)-Query1[parmAFELeeway]), (DATEDIFF(TODAY(),Query1[EstimatedSpud],DAY)-Query1[parmAFELeeway]))
Actually, I want to check whether the field is a proper date
@vignesh21,
Do you want to check that if the data type of FullAfeApproved column is date using dax? If so, it is not possible.
What data type do you set for the FullAfeApproved column? All values of the FullAfeApproved column can only be a single data type(e.g, Date). If you change data type of FullAfeApproved column to date, you are able to directly use DATEDIFF() function, and you are able to check if a value of FullAfeApproved column equals/is greater/is less than to a specific date value. Here is an example for you.
AFELeeway = if(Query1[FullAfeApproved] <=TODAY(),(DATEDIFF(Query1[FullAfeApproved],Query1[EstimatedSpud],DAY)-Query1[parmAFELeeway]), (DATEDIFF(TODAY(),Query1[EstimatedSpud],DAY)-Query1[parmAFELeeway]))
Regards,
Lydia
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
97 | |
79 | |
67 | |
60 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |