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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
gnaneshwar
Regular Visitor

Row wise calculation

I have requirement as per below:

P&L Statement has different values such as Revenue, Direct cost, Overheads, Depreciation& Interest,

Report shows P&L Statement wise Amount 

We want to show "Net Profit" calculated as "Revenue - (Direct cost+ Overheads+ Depreciation& Interest)" as mentioned below.

gnaneshwar_0-1713469991626.png

 

Any suggestions how to get this row-wise calculation

 

Thanks in advance.

Gnaneshwar

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @gnaneshwar 

Based on your description, you can consider the following solution.

Sample data 

vxinruzhumsft_0-1713491089695.png

1.Create a statement table , it include a index column

vxinruzhumsft_1-1713491116364.png

Sample measure

Sum = SUM('Table'[Value])

Click the statement column and select sort by Index column.

vxinruzhumsft_2-1713491177458.png

2.Then create a measure

MEASURE =
VAR a =
    CALCULATE ( [Sum], 'Table'[Statement] = "Revenue" )
VAR b =
    SUMX (
        FILTER (
            ALLSELECTED ( 'Table' ),
            [Month]
                IN VALUES ( 'Table'[Month] )
                    && [Statement] <> "Revenue"
        ),
        [Sum]
    )
RETURN
    IF (
        SELECTEDVALUE ( 'Statement'[Statement] ) <> "NetProfit",
        CALCULATE ( [Sum], 'Table'[Statement] IN VALUES ( 'Statement'[Statement] ) ),
        a - b
    )

Then put the statement field of the statement table to row , and month field of table to column , then put the measure to the value in matrix.

vxinruzhumsft_3-1713491334136.png

 

Output

vxinruzhumsft_4-1713491341489.png

 

Best Regards!

Yolo Zhu

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

1 REPLY 1
Anonymous
Not applicable

Hi @gnaneshwar 

Based on your description, you can consider the following solution.

Sample data 

vxinruzhumsft_0-1713491089695.png

1.Create a statement table , it include a index column

vxinruzhumsft_1-1713491116364.png

Sample measure

Sum = SUM('Table'[Value])

Click the statement column and select sort by Index column.

vxinruzhumsft_2-1713491177458.png

2.Then create a measure

MEASURE =
VAR a =
    CALCULATE ( [Sum], 'Table'[Statement] = "Revenue" )
VAR b =
    SUMX (
        FILTER (
            ALLSELECTED ( 'Table' ),
            [Month]
                IN VALUES ( 'Table'[Month] )
                    && [Statement] <> "Revenue"
        ),
        [Sum]
    )
RETURN
    IF (
        SELECTEDVALUE ( 'Statement'[Statement] ) <> "NetProfit",
        CALCULATE ( [Sum], 'Table'[Statement] IN VALUES ( 'Statement'[Statement] ) ),
        a - b
    )

Then put the statement field of the statement table to row , and month field of table to column , then put the measure to the value in matrix.

vxinruzhumsft_3-1713491334136.png

 

Output

vxinruzhumsft_4-1713491341489.png

 

Best Regards!

Yolo Zhu

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

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.