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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Please help us to get required format in power bi

Source have three column 1)Template 2)Selection description3)Question full description

 

Need power bi report in attached format where we have source coming from datamodel and Output is required in Power BI

 

 

 

Data.png

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous,

Use the matrix visual then place on rows the template and selection description in values place the question full description then you just need to drill down to the lowest level of the rows using the buttons on header of the matrix.

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

6 REPLIES 6
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on my research, It is unavailable to put two columns in the same hierarchy. As a workaround, you may create a calculated column to combine two columns.

 

calculated column:
Selection description & Question full description = 
Source[Selection description]&"  "&Source[Question full description]

 

 

Result:

c1.png

 

Best Regards

Allan

 

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

smpa01
Super User
Super User

@Anonymousdoable through M this way !!!

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCknNLchJLElV0lFySS1OLsosKMnMzzNE5RopxepEKwWCRIMSS4szEvOArMSkZGzCKalp2ITTMzKxCWdl50CEjYCc4MS8rMRKIMPRCYugswsWQVc3pdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Template", type text}, {"Description1", type text}, {"Description2", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type1", {"Template"}, {{"ad", each _, type table [Template=text, Description1=text, Description2=text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each let
X = [ad],
Y = Table.RemoveColumns(X,{"Template"})
in Y),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"ad"}),
    #"Transposed Table" = Table.Transpose(#"Removed Columns"),
    X = Table.RemoveColumns(#"Transposed Table",{"Column2"}),
    Y = Table.RemoveColumns(#"Transposed Table",{"Column1"}),
    Z = Table.RenameColumns(Y,{{"Column2", "Column1"}}),
    Custom1 = X&Z,
    #"Added Index" = Table.AddIndexColumn(Custom1, "Index", 1, 1),
    #"Filtered Rows" = Table.SelectRows(#"Added Index", each Number.IsEven([Index])=true),
    #"1" = Table.ExpandTableColumn(#"Filtered Rows", "Column1", {"Description1", "Description2"}, {"Description1", "Description2"}),
    #"2" = Table.SelectRows(#"Added Index", each (Number.IsEven([Index])=false)),
    Custom4 = #"1"&#"2",
    #"Sorted Rows" = Table.Sort(Custom4,{{"Index", Order.Ascending}}),
    #"Reordered Columns" = Table.ReorderColumns(#"Sorted Rows",{"Column1", "Description1", "Description2", "Index"}),
    #"Added Custom1" = Table.AddColumn(#"Reordered Columns", "Custom", each if [Description1]=null then [Column1] else [Description1]),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom1",{"Custom", "Description2", "Index"}),
    #"Replaced Value" = Table.ReplaceValue(#"Removed Other Columns",null,"",Replacer.ReplaceValue,{"Description2"})
in
    #"Replaced Value"

 

ewqasz.PNG

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
MFelix
Super User
Super User

HI @Anonymous ,

 

You can add the following measure to your model:

Question Full Description Text = CONCATENATEX('Table';'Table'[Question Full Description];UNICHAR(10))

 

This will give the result below (see attach PBIX file)

question.png

 

If you want to have also the Selection description repeated you can add a mesure similar to the previous one but refering to Selection Description column.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



MFelix
Super User
Super User

Hi @Anonymous,

Use the matrix visual then place on rows the template and selection description in values place the question full description then you just need to drill down to the lowest level of the rows using the buttons on header of the matrix.

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Thanks Miguel for prompt response.

 

I am not getting desired result.

 

Attaching the outcmome of your suggested solution.I am also attaching the required format in power BiData_2.PNG

 

Data_1.PNG

I think the most nearest would be

Screenshot 2020-02-08 18.39.16.png

 

Refer :https://docs.microsoft.com/en-us/power-bi/visuals/desktop-matrix-visual#stepped-layout-with-matrix-v...

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.