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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
jgreen82
New Member

Data in the wrong format?

Hi everyone, I don't know if I'm barking up the wrong tree or not. 

 

I'd like to show trends for particular focus groups in our school. I've organised the data in a way that I *think* is acceptible. But can't find tutorials or methods to show it how I'd like. A slicer for Focus group, and year then graphs to show the results in each of the subjects over time is what I'm after but I can't get there with my beginner knowledge! 

 

Not sure if this link works, but have you got any suggestions? Is the format of my data source my first stumbling block? 

 

Link to spreadsheet 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

 Is the format of my data source my first stumbling block? 

Absolutely.  That format is not usable. First order of business is to unpivot it and then to combine all sheets

 

let
    Source = Excel.Workbook(File.Contents("C:\Users\Lutz\Downloads\Trends - PowerBi .xlsx"), null, true),
    #"Filtered Rows" = Table.SelectRows(Source, each ([Hidden] = false)),
    #"Added Custom" = Table.AddColumn(#"Filtered Rows", "Custom", each Table.UnpivotOtherColumns(Table.PromoteHeaders([Data], [PromoteAllScalars=true]), {"Focus Group"}, "Attribute", "Value")),
    #"Removed Errors" = Table.RemoveRowsWithErrors(#"Added Custom", {"Custom"}),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Errors", "Custom", {"Focus Group", "Attribute", "Value"}, {"Focus Group", "Attribute", "Value"}),
    #"Removed Other Columns" = Table.SelectColumns(#"Expanded Custom",{"Item", "Focus Group", "Attribute", "Value"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Removed Other Columns",{{"Focus Group", type text}, {"Attribute", type text}, {"Value", type number}})
in
    #"Changed Type"

 

Now it is usable in Power BI and you can create whatever visuals you require.

 

lbendlin_0-1719884200681.png

 

 

 

 

 

View solution in original post

2 REPLIES 2
jgreen82
New Member

Thank you so much for taking the time to help me out. I'll have a look tonight to see if I can transform my own data. 

lbendlin
Super User
Super User

 Is the format of my data source my first stumbling block? 

Absolutely.  That format is not usable. First order of business is to unpivot it and then to combine all sheets

 

let
    Source = Excel.Workbook(File.Contents("C:\Users\Lutz\Downloads\Trends - PowerBi .xlsx"), null, true),
    #"Filtered Rows" = Table.SelectRows(Source, each ([Hidden] = false)),
    #"Added Custom" = Table.AddColumn(#"Filtered Rows", "Custom", each Table.UnpivotOtherColumns(Table.PromoteHeaders([Data], [PromoteAllScalars=true]), {"Focus Group"}, "Attribute", "Value")),
    #"Removed Errors" = Table.RemoveRowsWithErrors(#"Added Custom", {"Custom"}),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Errors", "Custom", {"Focus Group", "Attribute", "Value"}, {"Focus Group", "Attribute", "Value"}),
    #"Removed Other Columns" = Table.SelectColumns(#"Expanded Custom",{"Item", "Focus Group", "Attribute", "Value"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Removed Other Columns",{{"Focus Group", type text}, {"Attribute", type text}, {"Value", type number}})
in
    #"Changed Type"

 

Now it is usable in Power BI and you can create whatever visuals you require.

 

lbendlin_0-1719884200681.png

 

 

 

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Solution Authors
Top Kudoed Authors