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
ccsnet
Frequent Visitor

Changing Data To Make It Usable For A Graph

Hi all,

I have some data which is not in the best format which I would like to display on a single graph over time however Power BI seems to be struglering to show it more than a single straight line.

Can any body please offer some advice on how I can reformat using PowerQuery this so its useable in a repeatble way as this comes from a dynamic data source ?

NB The first row is how the data is imported and the yellow colums are the one I want to use, the second is an example of where I tried to tidy it up and use it

 

Capture.PNG

 

Thanks

Terran

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

A very simple way to transform would be

Load the table into PQ without headers i.e. your headers will be Column1, Column2...

Transpose

Select first column, right click and remove all duplicates

Transpose

Promote headers

Below is the code which gets generated

 

let
    Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    #"Transposed Table" = Table.Transpose(Source),
    #"Removed Duplicates" = Table.Distinct(#"Transposed Table", {"Column1"}),
    #"Transposed Table1" = Table.Transpose(#"Removed Duplicates"),
    #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table1", [PromoteAllScalars=true])
in
    #"Promoted Headers"

 

View solution in original post

2 REPLIES 2
ccsnet
Frequent Visitor

Thanks I will give this a go and come back to this thread.

 

T

Vijay_A_Verma
Super User
Super User

A very simple way to transform would be

Load the table into PQ without headers i.e. your headers will be Column1, Column2...

Transpose

Select first column, right click and remove all duplicates

Transpose

Promote headers

Below is the code which gets generated

 

let
    Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    #"Transposed Table" = Table.Transpose(Source),
    #"Removed Duplicates" = Table.Distinct(#"Transposed Table", {"Column1"}),
    #"Transposed Table1" = Table.Transpose(#"Removed Duplicates"),
    #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table1", [PromoteAllScalars=true])
in
    #"Promoted Headers"

 

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.