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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
PawelJanczak
Frequent Visitor

Conditional Output

Greetings,

 

I'm working on a conditional output, that will swich output table (if it's empty) to the predefined one. The code goes as:

 

#"Filtered Rows4" = Table.SelectRows(#"Added Custom3", each ([Custom] = "Object missing")),
Test = Table.IsEmpty(#"Filtered Rows4"), // returns TRUE, as logical value type I guess
TestOKTable = Table.FromRecords({[Message = "OK"]}),
Output = (if Test = "TRUE" then TestOKTable else #"Filtered Rows4") //no matther what, always returns #"Filtered Rows4" with 0 rows
in
Output

 

I'm looking for a hint what am I doing wrong, tried the Output = (if Test = TRUE then TestOKTable else #"Filtered Rows4") but returns error, seems I'm not able to properly refer to the TRUE result.

 

EDIT: the solution was simple, to refer properly to logical value is was required to write the code as:

Output = (if Test = true then TestOKTable else #"Filtered Rows4") // lower case need to be used without quotation

Case resolved....

 

Would appreciate any feedback.

1 ACCEPTED SOLUTION
artemus
Microsoft Employee
Microsoft Employee

You can simply this with just:

if Test then TestOKTable else #"Filtered Rows4"

 

View solution in original post

1 REPLY 1
artemus
Microsoft Employee
Microsoft Employee

You can simply this with just:

if Test then TestOKTable else #"Filtered Rows4"

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.