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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ODash
Regular Visitor

Combing Data Fields

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.

 

RefAspect 1Aspect 2Aspect 3
1ABC
2B  
3CA 
4A  

 

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.

 

RefAspect
1A
1B
1C
2B
3C
3A
4A

 

I'd welcome any thoughts please and let me know if you need any further explaination.

 

Many Thanks,

 

Ollie

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

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.PNG

2. Click the buttom at the right of value column and click remove empty.

3.PNG

4.PNG

3. Remove the Attribute column.

5.PNG

The result would be shown as below.

6.PNG

 

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.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

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.PNG

2. Click the buttom at the right of value column and click remove empty.

3.PNG

4.PNG

3. Remove the Attribute column.

5.PNG

The result would be shown as below.

6.PNG

 

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.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
camargos88
Community Champion
Community Champion

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



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

Proud to be a Super User!



Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.