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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
damtran
Regular Visitor

Sum of 50 columns in one table

Dear Power BI Experts,

I'm working on a table which requires to sum 50 columns in a Total column. Could you please help with any measure? I already add a new column but don't know what measure to use to sum such many like that? Thank you in advance.

 

Best regards,

Dam

1 ACCEPTED SOLUTION

Hi,

While it can be easily done in the Query Editor, ideally you should transform your data to show all weeks in a single column.  This transformed dataset will be amenable to further analysis.  You may transform the dataset by select all columns other than the week columns, right clicking and selecting "Unpviot Other columns".

Hope this helps.


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

View solution in original post

3 REPLIES 3
damtran
Regular Visitor

Hi Ashish, 

Thanks for your revert. I'd like to do it in Power Query.

Here's data for example, I would like to have total from week 1 to week 52, the blue column is expected sum.

 

DistrictWeek 1Week 2Week 3Week 4Week 5Week 6Week 7Week 8Week 9Week 10Week 11Expected total
Tan Binh5310471171164573
Phu Nhuan871164545510469
Binh Thanh845510473711670
Hoc Mon497711647116779

Hi,

While it can be easily done in the Query Editor, ideally you should transform your data to show all weeks in a single column.  This transformed dataset will be amenable to further analysis.  You may transform the dataset by select all columns other than the week columns, right clicking and selecting "Unpviot Other columns".

Hope this helps.


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

Hi,

Do you want to do this in the Query Editor or in DAX (as a calculated column formula)?  Do you want to ad the last 50 columns of the table?  Share some data and show the expected result. 


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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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