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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Percentages shows up as null while pivoting

Hi!

 

In data I have percentages of each training type, and when I do pivot some percentages turns out as null even if there was 100% before pivoting. 

It doesn't show any error, just turns some percentages to null. 

How I could fix it?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

You need to add index group by the Training Type first, you can put the following code to advanced editor.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk5MSy2pVNJRMlSK1YlWcnMPgLMDSxNzMtMykxNLMvPz4KLkazBA0mCAVYOBngUZdsQCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Training Type" = _t, #"Compliance %" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Training Type", type text}, {"Compliance %", Percentage.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Training Type"}, {{"Data", each Table.AddIndexColumn(_,"Index",1,1), type table }}),
    #"Expanded Data" = Table.ExpandTableColumn(#"Grouped Rows", "Data", {"Compliance %", "Index"}, {"Compliance %", "Index"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Expanded Data",{{"Compliance %", Percentage.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type1", List.Distinct(#"Changed Type1"[#"Training Type"]), "Training Type", "Compliance %", List.Sum)
in
    #"Pivoted Column"

Output

vxinruzhumsft_0-1705382973528.png

 

Best Regards!

Yolo Zhu

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous 

Can you provide some sample picture to display the problem you have faced, based on the information you offered above, the problem cannot be reproduced.

 

Best Regards!

Yolo Zhu

Anonymous
Not applicable

Sure.

Here for example how it looks before pivot:

SaltaSultan_0-1705375892192.png

And here is after:

SaltaSultan_1-1705375928370.png

#"Pivoted Column" = Table.Pivot(#"Removed Duplicates", List.Distinct(#"Removed Duplicates"[#"Training Type"]), "Training Type", "Compliance %", List.Sum)

 

Anonymous
Not applicable

Hi @Anonymous 

You need to add index group by the Training Type first, you can put the following code to advanced editor.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk5MSy2pVNJRMlSK1YlWcnMPgLMDSxNzMtMykxNLMvPz4KLkazBA0mCAVYOBngUZdsQCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Training Type" = _t, #"Compliance %" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Training Type", type text}, {"Compliance %", Percentage.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Training Type"}, {{"Data", each Table.AddIndexColumn(_,"Index",1,1), type table }}),
    #"Expanded Data" = Table.ExpandTableColumn(#"Grouped Rows", "Data", {"Compliance %", "Index"}, {"Compliance %", "Index"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Expanded Data",{{"Compliance %", Percentage.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type1", List.Distinct(#"Changed Type1"[#"Training Type"]), "Training Type", "Compliance %", List.Sum)
in
    #"Pivoted Column"

Output

vxinruzhumsft_0-1705382973528.png

 

Best Regards!

Yolo Zhu

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Kudoed Authors