March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Can someone comment on why this function is returning a value that looks like a date when it should return false?
Solved! Go to Solution.
@stribor45 Where exactly are you specifying that it is a true/false measure? Everything in the DAX is dealing with dates so you are likely running into the fact that DAX is a dynamically typed language and weakly typed. DAX tries to do a lot of guessing and automatic type conversion so it's likely that in DAX Studio or whatever you are in it's guessing that it should be returning a date or alternatively it's some kind of bug in DAX Studio. You'd have to ask @marcorusso about that though. However, I don't think it is a bug. Your first row returns a date for the second column, the maximum month in your Date table so I'm willing to bet that DAX is then guessing that the column is a date column and there you have it. Did you instead mean to return X for the second column in your first row?
In Power BI Desktop, if you copied the DAX code to create a table you could change the column to a boolean type and the problem would go away maybe, not sure what it would do with that first row second column value as is. Probably call it true since it is non-zero.
@Greg_Deckler is right, a column must have a single data type. It is the DAX engine that decides what data type to use, other tools (such as Power BI Desktop, DAX.DO, and DAX Studio) simply display the result produced by the query, but the decision is made by the DAX engine.
@Greg_Deckler is right, a column must have a single data type. It is the DAX engine that decides what data type to use, other tools (such as Power BI Desktop, DAX.DO, and DAX Studio) simply display the result produced by the query, but the decision is made by the DAX engine.
@stribor45 It's returning false or 0 which in terms of a date is December 30th, 1899
Why is it returning it as a date when this is a function that returns true/false?
@stribor45 Where exactly are you specifying that it is a true/false measure? Everything in the DAX is dealing with dates so you are likely running into the fact that DAX is a dynamically typed language and weakly typed. DAX tries to do a lot of guessing and automatic type conversion so it's likely that in DAX Studio or whatever you are in it's guessing that it should be returning a date or alternatively it's some kind of bug in DAX Studio. You'd have to ask @marcorusso about that though. However, I don't think it is a bug. Your first row returns a date for the second column, the maximum month in your Date table so I'm willing to bet that DAX is then guessing that the column is a date column and there you have it. Did you instead mean to return X for the second column in your first row?
In Power BI Desktop, if you copied the DAX code to create a table you could change the column to a boolean type and the problem would go away maybe, not sure what it would do with that first row second column value as is. Probably call it true since it is non-zero.
@Greg_Deckler That makes sense. No first row is showing as intended. Thank you for explaining this. Much appreciated
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
89 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |