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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
PBInonpro
Helper III
Helper III

Unpivot and 'sum' issues

I have a data source that has 12 columns for the year (Jan - Dec). The only way I see to run the model correctly is to unpivot the 12 columns and assign Jan - Dec a value of 1-12 (or rename and change to date format).

 

The issue is this, when I unpivot the columns the total sum is now 12 times the value it should be; do I need to make 12 different measures to account for each month for the sum or is there a DAX measure that can sum based on month. 

 

Example.

 

JanFebMar
51015
302520
1505

 

When I unpivot I get the following:

Jan5
Jan30
Jan15
Feb10
Feb25
Feb0
Mar15
Mar20
Mar5

 

Do I need to make a measure for each month? or is there a solution to only have one measure? The goal is forecast vs actual finance data. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PBInonpro ,

 

You could use group by to sum them up.

After unpivotted, you get this.

vstephenmsft_0-1669109902785.png

Right-click the Attribute column, select Group By...

vstephenmsft_1-1669109949847.png

Set up as follows and then click OK.

vstephenmsft_2-1669109969056.png

vstephenmsft_3-1669109998823.png

 

 

 

Best Regards,

Stephen Tao

 

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 @PBInonpro ,

 

You could use group by to sum them up.

After unpivotted, you get this.

vstephenmsft_0-1669109902785.png

Right-click the Attribute column, select Group By...

vstephenmsft_1-1669109949847.png

Set up as follows and then click OK.

vstephenmsft_2-1669109969056.png

vstephenmsft_3-1669109998823.png

 

 

 

Best Regards,

Stephen Tao

 

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

AllisonKennedy
Super User
Super User

@PBInonpro  Why is the total sum 10x what it should be? You can still slice by month, ideally using a dimDate table https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html 

 

You're definitely on the right track with the unpivot.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Thanks, I think this is the solution but is there a way to visualize this? I am not quite 100% grasping why the DIMDATE matters. 

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