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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

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.

View solution in original post

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

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.
Anonymous
Not applicable

Thank you very much for your help 🙂

Anonymous
Not applicable

Hi @Anonymous 

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 

 

Anonymous
Not applicable

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

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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