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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Manar
Helper II
Helper II

Replace empty table with 0

Hi,

I have a summary table that consist of a union of multiple tables , some of those tables might be empty instead I would like to show 0, but PowerBi doesn't show these table at all (it only showes the one with values in it). is there's a way to replace the empty tables with a zero?

 

 

SummaryTable2 = UNION('AccountingCompany 3','AccountingCurrencyCode 3','ClaimReference 3','ClaimType 3','EntryTime 3','HeaderReference 3','MovementAmountAccounting 3','MovementAmountBase 3','MovementAmountOriginal 3','MovementType 3','OriginalCurrencyCode 3','ReportingPeriod 3','TransactionAmountAccounting 3','TransactionAmountBase 3','TransactionAmountOriginal 3','TransactionDate 3') 

 

recontablePBI.png

1 ACCEPTED SOLUTION

Hi Helly,

 

What's the data source? Can you add one row of 0s in the data source? Please try the solution below and the demo in the attachment.

Add one row of 0s in the Query Editor.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i44FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Name = _t, Value = _t]),
    result = Table.InsertRows(Source, 0, {[Name = "0", Value = "0"]}) // Add this line by hand.
in
    result

Replace_empty_table_with_0

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-jiascu-msft
Employee
Employee

Hi @Manar,

 

Could you please mark the proper answer as a solution?

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Employee
Employee

Hi @Manar,

 

If you understand your requirements correctly, you want to show a row of 0s instead of nothing. The workaround is adding them in the source table before union.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for sharing your idea, because I don't have how to replace empty table ? 

 

Thansk

Helly

Hi Helly,

 

What's the data source? Can you add one row of 0s in the data source? Please try the solution below and the demo in the attachment.

Add one row of 0s in the Query Editor.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i44FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Name = _t, Value = _t]),
    result = Table.InsertRows(Source, 0, {[Name = "0", Value = "0"]}) // Add this line by hand.
in
    result

Replace_empty_table_with_0

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello 

 

Thanks for sharing valuable infromation. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.