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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Bug when creating a Calculated table with DirectQuery for Power BI datasets

There seems to be a bug related to the DAX function TRUE() when used in a Calculated table with DirectQuery for Power BI datasets.

Referencing a true/false column in the direct query dataset using the TRUE() function in a calculated table gives incorrect results.

 

The following example shows how to replicate this issue.

 

Create a new dataset with only one table and one column that is True/False and contains a few rows of data:

trueFalse1.png

Publish the dataset and create a new file that connects to the previous dataset and change to a local model

 

Create a calculated table with only one column and one row with this expression and the result is clearly incorrect. Only two rows have the value True but the calculation returns the value 4. 

trueFalse2.png

When tracing the query that is generated by the calculated table the issue is obvious as the TRUE() function in the Table expression is translated to the values {true, false} instead of only true.

trueFalse3.png

Changing the expression to count the rows that are true using <> FALSE() instead actually produces correct result as the expression generated to the direct query dataset now only contains the value true

trueFalse4.pngtrueFalse5.png

I hope this is enough information so that this issue can be addressed.

 

BR,

Magnus 

Status: New
Comments
v-lili6-msft
Community Support

hi

I have reported this issue internally, ICM: 233690663

will update here once I get any information.

 

Regards,

Lin

v-lili6-msft
Community Support

hi

I get this from pg:

Code is fixed. Will be released in May Desktop.

 

Regards,

Lin

Anonymous
Not applicable

Great, thanks!