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 sum a specific row in a matrix?

Hello, 
I'm very new about Power BI and so far I didn't find difficult, but now I have a issue about the sum. 
My goal is to sum a specific row in a matrix. 
Is it possible?

I know that is possible to create a cumulative sum, but I don't need of it. I need just of one value as in the example.
Below a simple example. 

powerBI question.jpg

 

Thank you in advance

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

I create a calculated column. The formula is as follows:

goal = 
IF(
    'Table'[X] = "25-30",
    CALCULATE(
        SUM('Table'[Z]),
        FILTER(
            'Table',
            'Table'[Index] <= EARLIER('Table'[Index])
        )
    )
)

 

The result is as follows, is this the output you want?

image.pngimage.png

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

6 REPLIES 6
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

I create a calculated column. The formula is as follows:

goal = 
IF(
    'Table'[X] = "25-30",
    CALCULATE(
        SUM('Table'[Z]),
        FILTER(
            'Table',
            'Table'[Index] <= EARLIER('Table'[Index])
        )
    )
)

 

The result is as follows, is this the output you want?

image.pngimage.png

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

I do not know well about your case, but by only seeing the screen capture, if you specify which category to show the result & other categories to hide, it is possible to demonstrate it.

(for instance, only show 25-30 category)

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Linkedin: https://www.linkedin.com/in/jihwankim1975/

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

Thanks @Jihwan_Kim for you reply. 
I understand the point, but how can select the filter that you mentioned?

Hi, 

You mean, how to select a specific category by slicer?

If you create a slicer from the existing table, and if you select a category, then the visualization would only show the selected category. I think this is what you want to ask.

In this case, the model needs to have a separate table (one column table) that only operates the slicer.

Then, this will only correspond to the measure based on the selection.

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

Thank you for the answer, but I'd like to create a column in the matrix that it is able to calculate the subtotal of a specific range. 
I need of this value becuase I have to implent it in a chart like threshold.

Hi,

Thank you for your feedback.

I am not sure about your specific case and a model, but in a general situation, it still can act as a threshold value even it is created as a measure.

If it is created as a calculated column, there will be some limitation, for instance, non-dynamic...

 

Thanks.

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.