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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Jack2of3
Helper II
Helper II

IF ('A'[B] = BLANK(), 'A'[C], 'A'[D]) Cannot convert data type text to true/false

Going in circles. I need a column that does 3 evaluations on different fields and provides different results based on the different fields. Gives error cannot convert data type TEXT to TRUE/FALSE

 

REASSIGN =
IF(DetailCkReq[Batch_Str] = "REC", "RECURRING") ||
 
IF(DetailCkReq[CKREQ_ASSIGNMENT.CKREQ_NO.] = BLANK(),
DetailCkReq[NAME], DetailCkReq[CKREQ_ASSIGNMENT.ASSIGNED_TO]) ||
 
IF(DetailCkReq[BATCH_ASSIGNMENT.BATCH_NAME] = BLANK(),
DetailCkReq[NAME], DetailCkReq[BATCH_ASSIGNMENT.ASSIGNED_TO])
1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Your DAX is trying to evaluate a logical combination of strings like "RECURRING" || "Detail Name" || "Detail Name", which doesn't make any sense since || can only combine True/False values, not text strings.

 

I think you may want something more like this:

REASSIGN =
SWITCH (
    TRUE (),
    DetailCkReq[Batch_Str] = "REC", "RECURRING",
    ISBLANK ( DetailCkReq[CKREQ_ASSIGNMENT.CKREQ_NO.] ),  DetailCkReq[NAME],
    ISBLANK ( DetailCkReq[BATCH_ASSIGNMENT.BATCH_NAME] ), DetailCkReq[NAME],
    DetailCkReq[BATCH_ASSIGNMENT.ASSIGNED_TO]
)

View solution in original post

4 REPLIES 4
AlexisOlson
Super User
Super User

Your DAX is trying to evaluate a logical combination of strings like "RECURRING" || "Detail Name" || "Detail Name", which doesn't make any sense since || can only combine True/False values, not text strings.

 

I think you may want something more like this:

REASSIGN =
SWITCH (
    TRUE (),
    DetailCkReq[Batch_Str] = "REC", "RECURRING",
    ISBLANK ( DetailCkReq[CKREQ_ASSIGNMENT.CKREQ_NO.] ),  DetailCkReq[NAME],
    ISBLANK ( DetailCkReq[BATCH_ASSIGNMENT.BATCH_NAME] ), DetailCkReq[NAME],
    DetailCkReq[BATCH_ASSIGNMENT.ASSIGNED_TO]
)

Perfect! I knew it had to be possible I just couldn't wrap my head around it.

Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi, @Jack2of3 
The results of your IF statements are Text Strings or false:
1 - is either "Recurring" or false
2 - is either [NAME] or [CKREQ_ASSIGNMENT.ASSIGNED_TO]
3 - [NAME] or [CKREQ_ASSIGNMENT.ASSIGNED_TO]

You have then included 1 or 2 or 3 which is expecting True/False , True/False or True/False.

I think you need to change the nesting of the conditions into a singe if statement.  However, I would consider moving this logic back into the Power Query.

I hope this helps point you in the right direction.

 

SWITCH(TRUE(),DetailCkReq[Batch_Str] = "REC", "RECURRING",
SWITCH (TRUE(),DetailCkReq[CKREQ_ASSIGNMENT.CKREQ_NO.] = BLANK(),
DetailCkReq[NAME], DetailCkReq[CKREQ_ASSIGNMENT.ASSIGNED_TO]),
 SWITCH(TRUE(),DetailCkReq[BATCH_ASSIGNMENT.BATCH_NAME] = BLANK(),
DetailCkReq[NAME], DetailCkReq[BATCH_ASSIGNMENT.ASSIGNED_TO]))

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.