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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
olofu
Frequent Visitor

Calculation on Matrix table

Hello to everyone,

I would like to obtain some calculation on PowerBI

Cattura.jpg

I created a matrix with 3 data columns (RE, RI, CE)  and I would like to have a new column with a calculation (RI+(RE-CE))

How can I do?

Thank you in advance

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

Hi @olofu,

Did these values analyze from attribute, value columns(attribute to matrix column field, value to matrix value field), or three value columns?

If you mean the first one, you need to calculate based on the Aree group and filter conditions:

Result =
CALCULATE (
    CALCULATE ( SUM ( Table[Value] ), [Type] = "RI" )
        + CALCULATE ( SUM ( Table[Value] ), [Type] = "RE" )
        - CALCULATE ( SUM ( Table[Value] ), [Type] = "CE" ),
    FILTER ( Table, [Area] = EARLIER ( Table[Area] ) )
)

If you mean the second one, you can directly create a calculated column to invoke these value fields to calculate:

Result =
Table[RI] + Table[RE] - Table[CE]

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @olofu,

Did these values analyze from attribute, value columns(attribute to matrix column field, value to matrix value field), or three value columns?

If you mean the first one, you need to calculate based on the Aree group and filter conditions:

Result =
CALCULATE (
    CALCULATE ( SUM ( Table[Value] ), [Type] = "RI" )
        + CALCULATE ( SUM ( Table[Value] ), [Type] = "RE" )
        - CALCULATE ( SUM ( Table[Value] ), [Type] = "CE" ),
    FILTER ( Table, [Area] = EARLIER ( Table[Area] ) )
)

If you mean the second one, you can directly create a calculated column to invoke these value fields to calculate:

Result =
Table[RI] + Table[RE] - Table[CE]

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
olofu
Frequent Visitor

I'm sorry @Fowmy but I cannot find the way for how to solve my question

Fowmy
Super User
Super User

@olofu 

I would suggest you to do it using Calculation Groups in Tabular Editor:
Please refer to this article on how to do it: https://blog.enterprisedna.co/matrix-in-power-bi-using-calculation-groups/




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 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 Kudoed Authors