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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
CLCrook
New Member

Normalize monthly financial records into multiple records for producing line graph

I have a table with denormalized data by month (could have multiple lines per vendor with additional monthly cost).

 

CLCrook_0-1733521796733.png

 

I need to create a traditional line chart with month on the x-axis and dollars on the y-axis based on filtering the data by various other fields in the table ("Source" == 'Budget') or ("Source" == 'Actual') for example. How can I do this in PowerQuery?

1 ACCEPTED SOLUTION
Chewdata
Super User
Super User

Hey,

You can Achievethis by selecting the P[no] FY2024 columns and select Unpivot Columns in the transform columns tab of Power Query. 
After that you can split the resulting Attribute column into both a Period and a Year Column.
I've used random values in the example.

Code snippet:

let
    Source = YOURDATA,
    UnpivColumns = Table.UnpivotOtherColumns(Source, {"Vendor"}, "Period", "Value"),
    SplitColumn = Table.SplitColumn(UnpivColumns, "Period", Splitter.SplitTextByDelimiter(" FY", QuoteStyle.Csv), {"Period", "Year"}),
    ChangeType = Table.TransformColumnTypes(SplitColumn,{{"Period", type text}, {"Year", Int64.Type}})
in
    ChangeType

 

outcome:

Chewdata_0-1733650255545.png

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @CLCrook ,

 

Did you find a solution? Did the above answers help? If so, mark the reply as a solution, which will help the next user with a similar problem, thank you~!

Best Regards,
Gao

Community Support Team

SacheeTh
Resolver II
Resolver II

To normalize your data for a line chart in Power BI, you need to unpivot the monthly columns into rows using Power Query. This transformation converts the wide table format (monthly data as columns) into a long format, with one column representing the months and another for the corresponding values (e.g., dollars).
After unpivoting, you can filter the data based on conditions like "Source == 'Budget'" or "Source == 'Actual'" and load it into Power BI.

Once transformed, you can create a line chart by assigning the unpivoted month column to the X-axis and the values column to the Y-axis. Ensure the month column is sorted chronologically, and apply any necessary filters to refine your visualization.
Else pivot back to the original state which will filter the columns you have filtered on the fitering stage.

Chewdata
Super User
Super User

Hey,

You can Achievethis by selecting the P[no] FY2024 columns and select Unpivot Columns in the transform columns tab of Power Query. 
After that you can split the resulting Attribute column into both a Period and a Year Column.
I've used random values in the example.

Code snippet:

let
    Source = YOURDATA,
    UnpivColumns = Table.UnpivotOtherColumns(Source, {"Vendor"}, "Period", "Value"),
    SplitColumn = Table.SplitColumn(UnpivColumns, "Period", Splitter.SplitTextByDelimiter(" FY", QuoteStyle.Csv), {"Period", "Year"}),
    ChangeType = Table.TransformColumnTypes(SplitColumn,{{"Period", type text}, {"Year", Int64.Type}})
in
    ChangeType

 

outcome:

Chewdata_0-1733650255545.png

 

Omid_Motamedise
Super User
Super User

Select all the columns, right click on one of them and pick unpivot other columns, then create a pivot table based on the result table.

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors