cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
irnm8dn Member
Member

True / False seen as Text Column - DAX Help!!!!

In my dataset, I have added an additional column that ouputs True, False or (blank).  Upon import, PBI sees it as text and I can't convert it to True/False in either Query Editor or in Data (left-rail).

 

The end goal is to write a DAX statement that interprets the value of True as "Complete" or False as "Incomplete".

 

When I add a function like:

 

Column 2 = IF('KPI Dashboard AD'[(Campaign) Creative Concierge]=True(),"Complete","False"

)

 

I get the following result:

 

DAX comparison operations do not support comparing values of type Text with values of type True/False. Consider using the VALUE or FORMAT function to convert one of the values.

 

Not sure what to do here...

8 REPLIES 8
tjd Established Member
Established Member

Re: True / False seen as Text Column - DAX Help!!!!

In the data view, use the Modeling ribbon and select "Data Type" and change the column to True/False.

irnm8dn Member
Member

Re: True / False seen as Text Column - DAX Help!!!!

@tjd

 

Thanks for the feedback.

 

When I change the Data Type I receive this window:

 

Data Type.PNG

 

And then I receive an error message that "We can't automatically cvonvert the column to True/False type.

 

Any thoughts.

tjd Established Member
Established Member

Re: True / False seen as Text Column - DAX Help!!!!

Does the column currently say "0" or "1" or "True"/"False"?  I believe that it has to be in 0/1 format to change to True/False.  What's 0 (True) depends on the question being asked in the column - e.g, if column heading is "Is Current?", then 0 would be true and 1 would be false.

irnm8dn Member
Member

Re: True / False seen as Text Column - DAX Help!!!!

@tjd

 

The columns have "Text" values of True, Flase (and blank).

 

 

tjd Established Member
Established Member

Re: True / False seen as Text Column - DAX Help!!!!

I'd try converting them on input to 0/1 and null and then see if they will convert to logical after inputting.

irnm8dn Member
Member

Re: True / False seen as Text Column - DAX Help!!!!

@tjd

 

Not sure that is an ideal solution.

 

Here's a little more context.

 

This column is newly added.  Like columns, from an earlier verision of the dataset, import as True/False - this one doesn't.  When I re-import in a NEW .pbix file, it imports with the correct format.

 

Not sure why I can't convert this one, or why a fresh "Get Data" works properly.  Would prefer not to rebuild the dashboards if possible.

v-huizhn-msft Super Contributor
Super Contributor

Re: True / False seen as Text Column - DAX Help!!!!

Hi @irnm8dn,

This might be fixed if you go into the query editor and see what automatic transformations Power BI makes when you import them,  please eliminate the step and and check if it works fine.

If your data type can't be converted to True/False type, you can change your DAX as follows, it might work correctly.

Column 2 = IF('KPI Dashboard AD'[(Campaign) Creative Concierge]="True","Complete","False"
)


Best Regards,
Angelia

v-huizhn-msft Super Contributor
Super Contributor

Re: True / False seen as Text Column - DAX Help!!!!

Hi @irnm8dn,

Have you resolved your issue? If you have, welcome to share your solution or mark the right reply as answer. More people will benefit from here.

Best Regards,
Angelia

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 414 members 4,384 guests
Please welcome our newest community members: