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
Heinrich
Post Partisan
Post Partisan

Show Text when No Data in a Table

Hello

I have a Table-Visual which has "Tracking-Numbers".

Sometimes there are no data then the table is empty.

Is it possible to change the empty table with a table which has a remark "No Data".

Thank you

Heinrich 

1 ACCEPTED SOLUTION

Hi Juan

 

I am glad that it is finally working!

 

This code should work for you:

let
    Quelle = SharePoint.Tables("https://axa365.sharepoint.com/sites/AXA-MicrosoftTeamsService", [Implementation="2.0", ViewMode="All"]),
    #"5aaa8718-9d99-4675-9214-078e6e3131a7" = Quelle{[Id="5aaa8718-9d99-4675-9214-078e6e3131a7"]}[Items],
    #"Hinzugefügte benutzerdefinierte Spalte" = Table.AddColumn(#"5aaa8718-9d99-4675-9214-078e6e3131a7", "Custom_Summary_as_Text", each Html.Table([Summary],{{"PlainText",":root"}})),
    #"Erweiterte Custom_Summary_as_Text" = Table.ExpandTableColumn(#"Hinzugefügte benutzerdefinierte Spalte", "Custom_Summary_as_Text", {"PlainText"}, {"Custom_Summary_as_Text.PlainText"}),
    Custom1 = if Table.IsEmpty(#"Erweiterte Custom_Summary_as_Text") then Table.InsertRows(#"Erweiterte Custom_Summary_as_Text",0,{ [#"Tracking-Number" = "Table Is Empty",#"Escalated" = "False"]}) else #"Erweiterte Custom_Summary_as_Text"
in
    Custom1

 

Let me know if it does.

 

Regards

Hugh

View solution in original post

30 REPLIES 30

Hey Juan

 

Yes, sure!

Here is the link to the file: Test.pbix 

 

Hope you come right with it. Let me know if you don't.

Have a great weekend too!

Hugh

Hello Hugh
Thank you very much.
I have downloaded and tested your Power BI.

But it is empty 

Heinrich_0-1678442576192.png

As this visual is from the table

Heinrich_1-1678442623037.pngHeinrich_2-1678442657694.png

Here the organization

Heinrich_4-1678442772870.png

 

Regards
Juan

 

Hi Juan

 

It seems as if I have saved the file with the empty table base64 string. Sorry about that.

I have saved the file with the original base64 string which contains the value, and changes to your DAX table. So feel free to grab the file again.

 

The main thing to look at is the step in the Applied Steps that checks if the table is empty and adds the row to say the table is empty.

Then in your Table Escalated Filtered Table, you can add 

|| 'Table Escalated'[Tracking-Number] = "Table Is Empty"

to your filter clause:

Table Escalated Filtered = FILTER('Table Escalated','Table Escalated'[Escalated]="false" || 'Table Escalated'[Tracking-Number] = "Table Is Empty")

 

Then in your visual it will show this:

HughLa_0-1678444758531.png

 

I hope it is what you are trying to achieve this time. 

Hugh

Hello Hugh

Hope you are having a great time.

 

Yes this worked. Great thank you.

 

If I would like to change the source from Excel to SharePoint List would this work

 

Sourcecode

let
//Base64 string for table with data: "i45WCvE1VNJRckvMKU5Vio0FAA==" 
//Base64 string for table without data: "i44FAA=="
    Quelle = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i44FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Tracking-Number" = _t, Escalated = _t]),
    #"Geänderter Typ" = Table.TransformColumnTypes(Quelle,{{"Tracking-Number", type text}, {"Escalated", type logical}}),
    Custom1 = if Table.IsEmpty(#"Geänderter Typ") then Table.InsertRows(#"Geänderter Typ",0,{ [#"Tracking-Number" = "Table Is Empty",#"Escalated" = "False"]}) else #"Geänderter Typ"
in
    Custom1

 

to 

let
    Quelle = SharePoint.Tables("https://axa365.sharepoint.com/sites/AXA-MicrosoftTeamsService", [Implementation="2.0", ViewMode="All"]),
    #"5aaa8718-9d99-4675-9214-078e6e3131a7" = Quelle{[Id="5aaa8718-9d99-4675-9214-078e6e3131a7"]}[Items],
    #"Hinzugefügte benutzerdefinierte Spalte" = Table.AddColumn(#"5aaa8718-9d99-4675-9214-078e6e3131a7", "Custom_Summary_as_Text", each Html.Table([Summary],{{"PlainText",":root"}})),
    #"Erweiterte Custom_Summary_as_Text" = Table.ExpandTableColumn(#"Hinzugefügte benutzerdefinierte Spalte", "Custom_Summary_as_Text", {"PlainText"}, {"Custom_Summary_as_Text.PlainText"})
    Custom1 = if Table.IsEmpty(#"Geänderter Typ") then Table.InsertRows(#"Geänderter Typ",0,{ [#"Tracking-Number" = "Table Is Empty",#"Escalated" = "False"]}) else #"Geänderter Typ"
in
    #"Erweiterte Custom_Summary_as_Text"

 

Is this ok?

 

Thank you

 

Have a great day

 

Juan

Hi Juan

 

I am glad that it is finally working!

 

This code should work for you:

let
    Quelle = SharePoint.Tables("https://axa365.sharepoint.com/sites/AXA-MicrosoftTeamsService", [Implementation="2.0", ViewMode="All"]),
    #"5aaa8718-9d99-4675-9214-078e6e3131a7" = Quelle{[Id="5aaa8718-9d99-4675-9214-078e6e3131a7"]}[Items],
    #"Hinzugefügte benutzerdefinierte Spalte" = Table.AddColumn(#"5aaa8718-9d99-4675-9214-078e6e3131a7", "Custom_Summary_as_Text", each Html.Table([Summary],{{"PlainText",":root"}})),
    #"Erweiterte Custom_Summary_as_Text" = Table.ExpandTableColumn(#"Hinzugefügte benutzerdefinierte Spalte", "Custom_Summary_as_Text", {"PlainText"}, {"Custom_Summary_as_Text.PlainText"}),
    Custom1 = if Table.IsEmpty(#"Erweiterte Custom_Summary_as_Text") then Table.InsertRows(#"Erweiterte Custom_Summary_as_Text",0,{ [#"Tracking-Number" = "Table Is Empty",#"Escalated" = "False"]}) else #"Erweiterte Custom_Summary_as_Text"
in
    Custom1

 

Let me know if it does.

 

Regards

Hugh

Hello Hugh
I ow you an apology for answering late.
Yes it did work. Fantastic work. Thank you.
Have a great weekend
Juan

Hey Juan

 

No problem, I am glad to hear that it worked. Have a great weekend too.

 

Hugh

Heinrich
Post Partisan
Post Partisan

Hi amitchandak

Thank you but I do not want to remove the table.

It means that only a row should be show with the remark "No Data"

Regards

Heinrich

amitchandak
Super User
Super User

@Heinrich , Follow the approach in blog . Show image/text there is no data

 

Show hide page
https://exceleratorbi.com.au/show-or-hide-a-power-bi-visual-based-on-selection/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

@Heinrich , Follow the approach in blog . Show image/text there is no data

 

Show hide page
https://exceleratorbi.com.au/show-or-hide-a-power-bi-visual-based-on-selection/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.