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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
FredLEGUEN
Helper III
Helper III

If test is true, then run a specific query

Hi group,

I have written a Power Query project to merge different files from different folders.

I'm facing an issue if one of the folders is empty.

For each folder, I have done 2 queries

  • The first query connect to the folder
  • The second execute the steps for the files

I would like to do a test before the second query like this

not(Table.IsEmpty(previousquery))

 

The test works but I just don't know how to write my query if the test returns true or false

 

Any idea?

1 ACCEPTED SOLUTION
FredLEGUEN
Helper III
Helper III

Hi,

 

Finally, I have found the way to write my condition and the 2 branches

let
    Source = if not(Table.IsEmpty(Query2)) then
        Table.Combine({Query1, Query2})
    else 
        Query1,

View solution in original post

2 REPLIES 2
FredLEGUEN
Helper III
Helper III

Hi,

 

Finally, I have found the way to write my condition and the 2 branches

let
    Source = if not(Table.IsEmpty(Query2)) then
        Table.Combine({Query1, Query2})
    else 
        Query1,
Anonymous
Not applicable

= if not(Table.IsEmpty(previousquery)) then QueryName else OtherQueryName

 

--Nate

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.