Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
116 | |
108 | |
106 | |
93 | |
69 |
User | Count |
---|---|
167 | |
132 | |
130 | |
96 | |
91 |