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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
rosh80
Regular Visitor

DAX if statement syntax error

Hi,

 

I am unable to use the IF conditional clause when creating a custom column. 

 

This is the DAX; 

IF(TABLE.COLUMN = TRUE(),"a","b).  This seems to have work in the August release of Power BI, not in the November release. I get the below error.

 

"Couldn't load the data for the visual.

 

OLEDB  or ODBC ERROR. Please try a simpler expression."

 

I am using direct query.

 

Thanks,

 

 

 

 

 

 

6 REPLIES 6
v-qiuyu-msft
Community Support
Community Support

Hi @rosh80,

 

Which Power BI desktop version do you run? 

 

Based on my test in Power BI desktop version 2.52.4921.682 64-bit (November 2017), get data from SQL database in DirectQuery, create a calculated column like yours, the calculated column values display fine in the table visual. 

 

q1.PNG

 

In your scenario, please run the same desktop version as ours. Make sure the data type of Column field is Bit in database assume you use SQL database. 

 

Best Regards,
Qiuyun Yu

 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I am using the November version. The database is Amazon Redshift and the datatype is boolean.

 

Thanks

Hi @rosh80,

 

Do you run desktop November version 2.52.4921.682? 

 

When you create this calculated column, is there any error throws out? 

 

Which visual do you use to show calculated column value? 

 

Could you share screenshots about the DAX and visual? Do mask sensitive data before uploading. 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your time.

 

if_issue.png

Hi @rosh80,

 

Please enable desktop trace log then repeat steps to reproduce the issue, upload the log files to your OneDrive and send the link in private message to me. 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rosh80
Regular Visitor

It doesnt seem to work for Boolean expressions, it is fine otherwise.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.