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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Independent Column Values for Pivot Table

Hi All,

 

I have an excel file that has 108 code columns like A6A** and A6K**.  I would like to count rows for every single values in excel. However, when I do it with Power BI Pivot Table, it automatically includes some column results to other column.  Like below; A6A** column results are under A6K** columns. 

 

vidividi12_2-1671567691289.png

 

Is there any way to do it for independent family results like below?I want to show each column value consecutively for each 108 columns.

 

vidividi12_1-1671567188258.png

 

 

 

 

1 ACCEPTED SOLUTION

Ok. Then... In Power Query M:

let
    Źródło = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Xc6xCoYwDATgd+nsYlrdU3pm+KekhQzF938NSxX5cQg33MeR3gNc2zyuTjGtYQm8/5hn8shz6UHh5jCyWmQYelC+UcaNxBQmQFO0FLf1o/JUUqoMIJEobjgQ04eVZ+zw0bqaOuhFf2+dFw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Long VIN" = _t, A6K = _t, A6A = _t]),
    #"Unpivot Other Columns" = Table.UnpivotOtherColumns(Źródło, {"Long VIN"}, "Family", "Value")
in
    #"Unpivot Other Columns"

 

Create New Measure:

Count of VIN = DISTINCTCOUNT('Sample'[Long VIN])

bolfri_0-1671569824885.png

 





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

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Anonymous
Not applicable

The sample data like below. Correct, one long VIN value has 108 code families like A6K and A6A. 

 

Long VIN A6K A6A
EWQTEWQTEASW2341 A6KAA A6AAA
QEWRWER2RSDG3412 A6KAB A6ABE
QGRQERGEETQET4351 A6KAB A6ABB
GDSGTQEG32235EFE34 A6KAB A6ABD
QGFWEFEWQRQWE234 A6KAA A6AAA

 

So based on this sample data that you have here:

Long VINA6KA6A
EWQTEWQTEASW2341A6KAAA6AAA
QEWRWER2RSDG3412A6KABA6ABE
QGRQERGEETQET4351
A6KABA6ABB
GDSGTQEG32235EFE34
A6KABA6ABD
QGFWEFEWQRQWE234
A6KAAA6AAA

 

What do you want to count? Based on this 5 rows?





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

Proud to be a Super User!




Anonymous
Not applicable

I want to count specific values for family columns. For example, when I want to get the counts for   A6KAB from A6K column and A6AAA from A6A column, the table should be like below.  I don't want to get results only for both A6KAB and A6AAA values. I would like to count both values seperately.

 

vidividi12_0-1671569460417.png

 

Ok. Then... In Power Query M:

let
    Źródło = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Xc6xCoYwDATgd+nsYlrdU3pm+KekhQzF938NSxX5cQg33MeR3gNc2zyuTjGtYQm8/5hn8shz6UHh5jCyWmQYelC+UcaNxBQmQFO0FLf1o/JUUqoMIJEobjgQ04eVZ+zw0bqaOuhFf2+dFw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Long VIN" = _t, A6K = _t, A6A = _t]),
    #"Unpivot Other Columns" = Table.UnpivotOtherColumns(Źródło, {"Long VIN"}, "Family", "Value")
in
    #"Unpivot Other Columns"

 

Create New Measure:

Count of VIN = DISTINCTCOUNT('Sample'[Long VIN])

bolfri_0-1671569824885.png

 





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

Proud to be a Super User!




bolfri
Solution Sage
Solution Sage

Can you post sample data? I think the issue here is that have 2 columns in your matrix: columnA with value A6KAH and a columnB with value A6AAA. Then using a count of Long VIN you are receiving this combination in matrix. 🙂 





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

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.