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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Can I expand the content of table located in a column of a Table visual into another Table visual ?

Hello,

I have a query that returns several rows and columns, one of the columns is a Table, called "Details". Is there a way to expand the content of this table in a visual on Power BI ?

What I would like is to have a first Table visual displaying the content of my query, and once I click on one or more rows of the first Table visual, it should expand the content of the Details column into a second Table visual.

Here is the code for my query :

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUtJRCs8vyi4uSSzJzM8D8oDIUClWJ1opKzexKBlD2is1MU9HwRciZQRWmF6SkZlahKHSvbS0WEchBCpnDFaakZeYmwrkOefn5pbmZSaD1Sq4pJZlJoOEPTKBOvwgSkzAGjKhGlCN9kwtgqszJd4NZqS6wZx4sy2UYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [assigned_to.user_name = _t, model_category.display_value = _t, assigned_to.name = _t, Index = _t]),
    #"Type modifié" = Table.TransformColumnTypes(Source,{{"assigned_to.user_name", type text}, {"model_category.display_value", type text}, {"assigned_to.name", type text}, {"Index", Int64.Type}}),
    
    #"Personnalisée ajoutée1" = Table.AddColumn(#"Type modifié", "IsUserNameAssigned", each if [assigned_to.user_name] = "" then "Blank" else "Not Blank"),
    #"Lignes filtrées1" = Table.SelectRows(#"Personnalisée ajoutée1", each ([IsUserNameAssigned] = "Not Blank")),
    #"Personnalisée ajoutée2" = Table.AddColumn(#"Lignes filtrées1", "Details", (k)=> Table.SelectRows(#"Lignes filtrées1", 
            each if [model_category.display_value] = "Workstation" then ([assigned_to.name] = k[assigned_to.name] and k[model_category.display_value] = "Workstation")
                                                                   else ([assigned_to.name] = k[assigned_to.name] and k[model_category.display_value] = "Communication Device"))),
    #"Personnalisée ajoutée3" = Table.AddColumn(#"Personnalisée ajoutée2", "nbMaterielParPersonne", each if Table.RowCount([Details]) > 1 then "MORETHANONE" else "ONLYONE"),
    #"Lignes filtrées2" = Table.SelectRows(#"Personnalisée ajoutée3", each ([nbMaterielParPersonne] = "MORETHANONE")),
    #"Lignes triées" = Table.Sort(#"Lignes filtrées2",{{"assigned_to.name", Order.Ascending}})
in
    #"Lignes triées"

 

 

2 REPLIES 2
pranit828
Community Champion
Community Champion

Hi @Anonymous ,

You can click on the icon which will open a window for you to select the columns.

pranit828_1-1680200257494.pngpranit828_2-1680200299093.png

Once the columns are selected click "OK" and you will have all the columns.

pranit828_3-1680200337104.png

Here is the M-Code for your reference.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUtJRCs8vyi4uSSzJzM8D8oDIUClWJ1opKzexKBlD2is1MU9HwRciZQRWmF6SkZlahKHSvbS0WEchBCpnDFaakZeYmwrkOefn5pbmZSaD1Sq4pJZlJoOEPTKBOvwgSkzAGjKhGlCN9kwtgqszJd4NZqS6wZx4sy2UYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [assigned_to.user_name = _t, model_category.display_value = _t, assigned_to.name = _t, Index = _t]),
    #"Type modifié" = Table.TransformColumnTypes(Source,{{"assigned_to.user_name", type text}, {"model_category.display_value", type text}, {"assigned_to.name", type text}, {"Index", Int64.Type}}),
    
    #"Personnalisée ajoutée1" = Table.AddColumn(#"Type modifié", "IsUserNameAssigned", each if [assigned_to.user_name] = "" then "Blank" else "Not Blank"),
    #"Lignes filtrées1" = Table.SelectRows(#"Personnalisée ajoutée1", each ([IsUserNameAssigned] = "Not Blank")),
    #"Personnalisée ajoutée2" = Table.AddColumn(#"Lignes filtrées1", "Details", (k)=> Table.SelectRows(#"Lignes filtrées1", 
            each if [model_category.display_value] = "Workstation" then ([assigned_to.name] = k[assigned_to.name] and k[model_category.display_value] = "Workstation")
                                                                   else ([assigned_to.name] = k[assigned_to.name] and k[model_category.display_value] = "Communication Device"))),
    #"Personnalisée ajoutée3" = Table.AddColumn(#"Personnalisée ajoutée2", "nbMaterielParPersonne", each if Table.RowCount([Details]) > 1 then "MORETHANONE" else "ONLYONE"),
    #"Lignes filtrées2" = Table.SelectRows(#"Personnalisée ajoutée3", each ([nbMaterielParPersonne] = "MORETHANONE")),
    #"Lignes triées" = Table.Sort(#"Lignes filtrées2",{{"assigned_to.name", Order.Ascending}}),
    #"Expanded Details" = Table.ExpandTableColumn(#"Lignes triées", "Details", {"assigned_to.user_name", "model_category.display_value", "assigned_to.name", "Index", "IsUserNameAssigned"}, {"Details.assigned_to.user_name", "Details.model_category.display_value", "Details.assigned_to.name", "Details.Index", "Details.IsUserNameAssigned"})
in
    #"Expanded Details"

 

 





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile
Anonymous
Not applicable

Thank you but it is actually not at all what I am talking about. I want to see the content of the Details column in a Power BI visual, not on the power query side.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.