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
nhviet
Regular Visitor

replace an empty table with a null or 0 row

Hi,

I have a situation that needs your help.

I have a table A, I use Power Query to split table A into 2 tables Typ and Cus. In some cases, only the Typ table has value and the Cus table has no value at all. I want if the Custom table has no value, it will automatically create a line of 0 values corresponding to the fields.

I also researched the M language in query, but I couldn't understand it.

Could you please recommend me how to do that?

Best Regards,

Viet

1 REPLY 1
jennratten
Super User
Super User

Hello - you can do something like this... add a new table with the appropriate structure and a row with zero values (in the example below this is SampleTable); perform the necessary split, then conditionally proceed with either the split table with rows or the sample table if there are no rows.

if Table.IsEmpty ( Table2 ) then SampleTable2 else Source

Result

jennratten_0-1694520646339.png

 

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.

Top Kudoed Authors