Reply
Syndicate_Admin
Administrator
Administrator
Syndicated - Inbound

Calculate total column value in power query

Source Community: Power BI Spanish | Source Author Name: Jaques_RJTB

Hello everyone, I have a situation, I want to assemble a column of cumulative total of the value of the column "Rs" to be able to take an average of it.

Jaques_RJTB_0-1684786120829.png

This is the way I want to visualize it but it is calculated automatically because it comes from a database that they constantly update.

Jaques_RJTB_1-1684786242830.png

Thank you very much, I hope

1 ACCEPTED SOLUTION
avatar user
Anonymous
Not applicable

Syndicated - Outbound

Hi ,

Please have a try.

Click on the 'Add Column' tab in the ribbon, and then select 'Custom Column'.In the 'Custom Column' dialog box, enter a name for the new column (e.g. 'Cumulative Total').In the 'Custom Column' dialog box, enter the following formula:

= List.Sum(List.FirstN([Rs], CurrentRowIndex + 1))

This formula calculates the cumulative total of the 'Rs' column up to the current row.

Once you have created the cumulative total column, you can take an average of it by selecting the column and clicking on the 'Average' button in the 'Transform' tab of the ribbon.

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

1 REPLY 1
avatar user
Anonymous
Not applicable

Syndicated - Outbound

Hi ,

Please have a try.

Click on the 'Add Column' tab in the ribbon, and then select 'Custom Column'.In the 'Custom Column' dialog box, enter a name for the new column (e.g. 'Cumulative Total').In the 'Custom Column' dialog box, enter the following formula:

= List.Sum(List.FirstN([Rs], CurrentRowIndex + 1))

This formula calculates the cumulative total of the 'Rs' column up to the current row.

Once you have created the cumulative total column, you can take an average of it by selecting the column and clicking on the 'Average' button in the 'Transform' tab of the ribbon.

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)