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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
rock_cloud
Frequent Visitor

Structuring Pre-aggregated Data

Hi,

 

I'm wondering whether anyone can help me as I'm quite stuck.

 

I don't have direct access to my data source for use in Power BI, so my data is pre-aggregated before I import it. My data contains a multiple different tables with the same categories for example:

Measure 1:

MonthDepartment1Department2Total
Feb-24254562816
Jan-24201487688
Dec-23225421646
Nov-23284500784
Oct-23178497675

 

Measure 2:

MonthDepartment1Department2Total
Feb-24181441622
Jan-24224543767
Dec-23258429687
Nov-23232497729
Oct-23193552745


How can I structure this data so that I can use Department 1, 2 and Total as series in visuals and filters in a slicer, as well as being able to use the date in a slicer. I've so far only been able to the sum of the departments to a visual without them being individual series.

 

Apologies if this is very basic and straightforward.

Many thanks.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rock_cloud ,
According to your description, you can use the unpivot function in power query. The exact steps are:
1. Click Transform data to open the power query interface

vheqmsft_0-1712802158360.png


2. Select the Department1 Department2 columns, right click and select the unpivot columns option.

vheqmsft_1-1712802176043.png

At this time there will be a total, department name and department id for the columns of the table

vheqmsft_3-1712802198663.png

So you can filter by date, department name or total.

vheqmsft_4-1712802386203.png

 

Best regards,

Albert He

 

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

Many thanks for these solutions! Worked perfectly and saved a massive headache! 👍

Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor,

  1. Remove the total column from each table
  2. Append all the tables
  3. Select the first column, right click and select "Unpivot Other Columns"

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @rock_cloud ,
According to your description, you can use the unpivot function in power query. The exact steps are:
1. Click Transform data to open the power query interface

vheqmsft_0-1712802158360.png


2. Select the Department1 Department2 columns, right click and select the unpivot columns option.

vheqmsft_1-1712802176043.png

At this time there will be a total, department name and department id for the columns of the table

vheqmsft_3-1712802198663.png

So you can filter by date, department name or total.

vheqmsft_4-1712802386203.png

 

Best regards,

Albert He

 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

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.