Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi,
I'm relativly new to Power BI and am at the exploring stage to see if it can work for me.
I've got to a point of I know what I'd like to do, but not even sure if it's possible, so hopefully someone can assist.
I currently have a table of references, with aspects for each as below.
Ref | Aspect 1 | Aspect 2 | Aspect 3 |
1 | A | B | C |
2 | B | ||
3 | C | A | |
4 | A |
Each ref can have multiple aspects, and the number of the aspect is largely irrelavent for my purposes, so I'd like to combine the aspects into one column. So for example I can search for all References that have an aspect of A.
I believe if I can format the table as below it will work in BI, but as it's a large dataset I'm not sure that a manageable solution.
Ref | Aspect |
1 | A |
1 | B |
1 | C |
2 | B |
3 | C |
3 | A |
4 | A |
I'd welcome any thoughts please and let me know if you need any further explaination.
Many Thanks,
Ollie
Solved! Go to Solution.
Hi @ODash ,
You can also use the unpivot feature and remove empty feature in Query Editor.
Please check the following steps.
1. Select the tree columns and click unpivot.
2. Click the buttom at the right of value column and click remove empty.
3. Remove the Attribute column.
The result would be shown as below.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ODash ,
You can also use the unpivot feature and remove empty feature in Query Editor.
Please check the following steps.
1. Select the tree columns and click unpivot.
2. Click the buttom at the right of value column and click remove empty.
3. Remove the Attribute column.
The result would be shown as below.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ODash ,
You just need to unpivot the other columns.
Here is the code, just past on Advanced Editor on Power Query:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXIEYicgdlaK1YlWMoLyFMAYJGIMloOog4iYwHlgkVgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Ref = _t, #"Aspect 1" = _t, #"Aspect 2" = _t, #"Aspect 3" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Ref", Int64.Type}, {"Aspect 1", type text}, {"Aspect 2", type text}, {"Aspect 3", type text}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Ref"}, "Attribute", "Value"),
#"Filtered Rows" = Table.SelectRows(#"Unpivoted Other Columns", each ([Value] <> " "))
in
#"Filtered Rows"
Ricardo
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
83 | |
69 | |
68 | |
39 | |
37 |