cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
naxie Frequent Visitor
Frequent Visitor

How to calculate a sum based on multiple rows of a different table

Please, can someone help me to make sum of time periods of each state (can occure more than once)? The summed data in new table will be used for further calculations.

data.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to calculate a sum based on multiple rows of a different table

Hi @naxie ,

 

You could use pivot to do it.

1. Import the file into Power BI. 

2. Open the query editor.

4-1.PNG

3. Remove the "change_date" and "from_state" column. Now you get a three-column table.(the following image is my test file) 

4-2.PNG

4. Then select "state" column, click the "Pivot Column" in the transform tab.

4-3.PNG

4-4.PNG

5. Click Close & Apply, you will get the result.

4-5.PNG

 

Community Support Team _ Eads
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

4 REPLIES 4
Westbf Frequent Visitor
Frequent Visitor

Re: How to calculate a sum based on multiple rows of a different table

Hi @naxie 

Try the "group by" function in power query editor. 

there you can sum based on differnt columns. 

if you provide an example report i can show you if unclear.

kr 

 

Community Support Team
Community Support Team

Re: How to calculate a sum based on multiple rows of a different table

Hi @naxie ,

 

You could use pivot to do it.

1. Import the file into Power BI. 

2. Open the query editor.

4-1.PNG

3. Remove the "change_date" and "from_state" column. Now you get a three-column table.(the following image is my test file) 

4-2.PNG

4. Then select "state" column, click the "Pivot Column" in the transform tab.

4-3.PNG

4-4.PNG

5. Click Close & Apply, you will get the result.

4-5.PNG

 

Community Support Team _ Eads
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

naxie Frequent Visitor
Frequent Visitor

Re: How to calculate a sum based on multiple rows of a different table

The Group function would be perfect only if I could specify the particular value for filtered rows (issue key, current state=idea, etc.) for each new column the Group function would create:group.png

 

naxie Frequent Visitor
Frequent Visitor

Re: How to calculate a sum based on multiple rows of a different table

Thank you very much for your help 🙂

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 411 members 3,664 guests
Please welcome our newest community members: