Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
89 | |
87 | |
81 | |
64 | |
49 |
User | Count |
---|---|
123 | |
109 | |
88 | |
68 | |
67 |