Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

table data presentation

Hi All,

I have a table table1. but i want that table to be shown in my report tab like it is in the below format (right table) in PowerBI using a visual or power query or anything else . can this happen?

 

 

Regards,

Chahat

  • HI Anonymous 

    If so, you need to duplicate the basic data and transform it in duplicate table.

    Then create the relationship by Name

    Result:

    and here is sample pbix file, please try it.

     

    Regards,

    Lin

6 Replies

  • Go to power query editor - - > select Name column - - > go to transform tab - - > unpivot column.

    After that in above name column append "fd" at the end of the text.

    Please give Kudos and accept this as a solution if it helps you.
  • JarroVGIT's avatar
    JarroVGIT
    Resident Rockstar

    Well, the problem I got stuck to in referencing the columnnames rather than the values in those columns. I was thinking something allong the lines of using UNION() and SELECTEDCOLUMNS() to create a new table but because you also want to keep the original columns it isn't really an unpivot action. 

    Few questions: are the column names static or do you want this to be dynamic? Can you change the source? Do you want this to be done in power query or in DAX?

     

    Kind regards

    Djerro123

    -------------------------------

    If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

    Kudo's are welcome 🙂

  • Anonymous tranform the data in power query, copy following script and then use matrix visual to product the result

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSs5ILMrJTFXSUTI0NAKSRsaGSrE60UqpRZnJYK4JkDQ2MlKKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Name = _t, col1_fd = _t, col2_rd = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"col1_fd", Int64.Type}, {"col2_rd", Int64.Type}}),
        #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Name"}, "Attribute", "Value"),
        #"Inserted Text After Delimiter" = Table.AddColumn(#"Unpivoted Other Columns", "col_tag", each Text.AfterDelimiter([Attribute], "_"), type text),
        #"Added Custom" = Table.AddColumn(#"Inserted Text After Delimiter", "Name New", each ([Name]&" " &[col_tag]), type text),
        #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Name", "col_tag"}),
        #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Name New", "Name"}})
    in
        #"Renamed Columns"

     

     

      • Anonymous's avatar
        Anonymous
        Not applicable

        parry2k thankyou so much for your help. but I need to show both the tables (showing the same data but just in different format) in my report tab. so can i achieve this in dax or some other way so that i can show both the tables visuals through one data table only.

        .   

         

        Regards,

        Chahat