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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
DarylRob
Helper I
Helper I

DAX : Pivot a table to get totals

So I've got the below table imported. 

 

NameRegionProject NameTotal MRRTotal Hours
AndyUS 1005
TrevorUK 20010
AndyUS 30015
TrevorUK 400

20

SandyUS 500

25

 

I then want to be able to create a calculated table that will come out as below

 

RegionNameTotal MRRTotal Hours
USAndy40020
UKTrevor60030
USSandy50025

 

So I basically just want ot pivot up the totals of each person. 

 

I'm new to Power BI so don't know where to start

 

Thanks, 

1 ACCEPTED SOLUTION
bcdobbs
Community Champion
Community Champion

If you did specifically want a calculated table you could do this:

bcdobbs_2-1640199289719.png

SummaryTable = 
SUMMARIZECOLUMNS(
    MainTable[Region],
    MainTable[Name],
    "Total Hours", CALCULATE ( SUM ( MainTable[Total Hours] ) ),
    "Total MRR", CALCULATE ( SUM ( MainTable[Total MRR] ) )
)


Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

It looks like you want a visual and not a calculated table.  If that is the case, do this.  To your Table/matrix visual, drag Region and Name.  Write these measures:

MRR total = sum(Data[Total MRR])

Hours = sum(Data[Total hours])

Hope this helps. 


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

Thanks Asish, but I then want to be able to put this into a line chart to show progression over time, which wouldnt work with this would it?

Hi,

For that you must have a Date column in your dataset as well.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
bcdobbs
Community Champion
Community Champion

If you did specifically want a calculated table you could do this:

bcdobbs_2-1640199289719.png

SummaryTable = 
SUMMARIZECOLUMNS(
    MainTable[Region],
    MainTable[Name],
    "Total Hours", CALCULATE ( SUM ( MainTable[Total Hours] ) ),
    "Total MRR", CALCULATE ( SUM ( MainTable[Total MRR] ) )
)


Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Now i've got another table that's got Q1, Q2, Q3, Q4 row data in how would I bring that into this? Call it table2 and its as below

 

NameQuarterMRR QuotaHours Quota
AndyQ1100050
AndyQ2200050
AndyQ3300050
AndyQ4400050

This is perfect, thank you

bcdobbs
Community Champion
Community Champion

Hi,
Do you specifically need a calculated table or just want a visual to display a table like that?

If the later just drop the columns into a table visual like this:

bcdobbs_0-1640198972502.png

 

Power Bi by will guess what agregation you want for a numeric column but you can check it by clicking the down arrow on a field after you drop it into a viusal:

bcdobbs_1-1640199118753.png

 

Can send the DAX over if you specifically want a calculated table.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Hi, 

I forgot to include the date columns that i'll also have (Q1, Q2, Q3, Q4) which I then want to be able to show in a line chart. Which I don't think I can do via this method?

bcdobbs
Community Champion
Community Champion

Can you mock up a demo pbix file and send it. Think even bringing dates in you can keep it simple maybe with the addition of a date table. Might be missing something though.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.