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
Peter_2020
Helper III
Helper III

SUM of values in specific rows

Hi all, 

 

I would like to ask you for help with following issue:

 

I have the table "PRODUCTION" with data about orders, operations and production hours:

Peter_2020_1-1600773371152.png

As you can see I have 4 orders (1060370272, 1060370274, 1060371650, 1060371662) with different operations and different reported hours. What I want to achieve is the chart with SUM of hours but only for each order which contain operation "0200". In that case the result looks like this:

Peter_2020_2-1600773772358.png

The question is how to define formula for calculation of that kind of measure.

Thank you for help!

P.

 

1 ACCEPTED SOLUTION
Sumanth_23
Memorable Member
Memorable Member

hi @Peter_2020 - You can implement the same using the below approach. 

 

1. I have created a measure for Total Hours: Tot Hours = SUM(PRODUCTION[Hours])

 

2. Added a calculated column to identify Orders which have operation type "0200" : 

Operation_check = IF ( PRODUCTION[Operation] = "0200" , 1, 0)

 

Count Hours 1.png

 

3. Plotted Orders vs. Tot Hours and then applied a visual level filter to only show orders that had a "Operation_check" = 1

 

Count Hours 2.png

 

Please mark the post as a solution and provide a 👍 if my solution helped with solving your issue. Thanks!

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!

Proud to be a Super User!



View solution in original post

6 REPLIES 6
Sumanth_23
Memorable Member
Memorable Member

hi @Peter_2020 - You can implement the same using the below approach. 

 

1. I have created a measure for Total Hours: Tot Hours = SUM(PRODUCTION[Hours])

 

2. Added a calculated column to identify Orders which have operation type "0200" : 

Operation_check = IF ( PRODUCTION[Operation] = "0200" , 1, 0)

 

Count Hours 1.png

 

3. Plotted Orders vs. Tot Hours and then applied a visual level filter to only show orders that had a "Operation_check" = 1

 

Count Hours 2.png

 

Please mark the post as a solution and provide a 👍 if my solution helped with solving your issue. Thanks!

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!

Proud to be a Super User!



@Sumanth_23 Thank you very much for your help! It solved my problem.

hi @Peter_2020 - Happy to help! 🙂

 

Do kudo the solution so it highlights to other folks with a similar request as well. Thanks!  

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!

Proud to be a Super User!



ryan_mayu
Super User
Super User

@Peter_2020 

Maybe you can try

CALCULATE(SUM(Hours),FILTER(TABLE, OPERATION="0200")





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan

sorry Ryan, but it doesn´t work. I need to define somehow that I need calculate sum of all rows for column "hours" just for orders which contain operation "0200"...

@Peter_2020 

please provide some sample data and the expected output.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.