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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rakunn
Frequent Visitor

Calculating rows in Power Bi

Hello everyone,

 

I am building financial report and I need to calculate Profit minus Operating Revenues row. Lets say, my table looks following:

 

Level 0Level 1Value
RevenuesSales100,00
Operating expensesOutsourcing30,00
Operating expensesSalaries50,00
Operating expensesOther10,00

 

My question is, can I put in the Matrix table row called Revenues minus Operating expenses, which will calculate the result?

 

In excel and pivot tables, I am able to do that with option "Calculated item", and I would like to do the same in Power BI, as below:

 

Row LabelsSum of Value
1. Revenues 
Sales100
2. Operating expenses 
Other10
Outsourcing30
Salaries50
3. Revenues - Operating expenses10
  

 

All I can add is new column and I do not see option like "add calculated row". If you need more details please tell.

 

Best wishes,

Rafał

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi, @rakunn

 

Please follow the screenshots to work around your issue.

 

1.PNG2.PNG3.PNG4.PNG

 

Reference to DAX formulas:

Table1 =
SUMMARIZE (
    'financial report',
    'financial report'[Level0],
    'financial report'[Level1],
    "SumOfValue", SUM ( 'financial report'[Value] )
)

Table4 =
SUMMARIZE (
    'financial report',
    'financial report'[Level0],
    "RowLebels", "Revenues - Operating expenses",
    "Level1", BLANK (),
    "SumOfValue", LASTNONBLANK ( Table1[SumOfValue], SUM ( 'financial report'[Value] ) )
        - SUM ( 'financial report'[Value] )
)

Table 5 =
SUMMARIZE (
    SELECTCOLUMNS (
        Table4,
        "RowLebels", Table4[RowLebels],
        "Level1", BLANK (),
        "SumOfValue", Table4[SumOfValue]
    ),
    [RowLebels],
    "Level1", BLANK (),
    "SumOfValue", SUM ( Table4[SumOfValue] )
)

Table6 = UNION(Table1,'Table 5')

If you have any question, please feel free to ask.

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
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
sekarsdream
New Member

Hello Everyone i have similar kind of issue, i need to calulate the percentage of the indiidual values with the total for each column for different month as shown in the figure.Capture.PNG

v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi, @rakunn

 

Please follow the screenshots to work around your issue.

 

1.PNG2.PNG3.PNG4.PNG

 

Reference to DAX formulas:

Table1 =
SUMMARIZE (
    'financial report',
    'financial report'[Level0],
    'financial report'[Level1],
    "SumOfValue", SUM ( 'financial report'[Value] )
)

Table4 =
SUMMARIZE (
    'financial report',
    'financial report'[Level0],
    "RowLebels", "Revenues - Operating expenses",
    "Level1", BLANK (),
    "SumOfValue", LASTNONBLANK ( Table1[SumOfValue], SUM ( 'financial report'[Value] ) )
        - SUM ( 'financial report'[Value] )
)

Table 5 =
SUMMARIZE (
    SELECTCOLUMNS (
        Table4,
        "RowLebels", Table4[RowLebels],
        "Level1", BLANK (),
        "SumOfValue", Table4[SumOfValue]
    ),
    [RowLebels],
    "Level1", BLANK (),
    "SumOfValue", SUM ( Table4[SumOfValue] )
)

Table6 = UNION(Table1,'Table 5')

If you have any question, please feel free to ask.

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello Yuliana,

 

Many thanks for your time and effort put in your post.

 

DAX is truly impressive, but may be a little bit of intimidating for less experienced users (like me). Have you heard about some good online courses about this language? Or powerbi.com resources will suffice?

 

Hope to hear from you soon,

Rafał

Hi @rakunn

 

Microsoft provides many documents written about the snytax and usage of DAX function:

Data Analysis Expressions (DAX) Reference

 

Thanks,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors