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
Anonymous
Not applicable

How to create the calculated rows in P&L statement.

Hello Community Team,

 

We are trying to create the Profit and Loss statement in Power BI, I am doing this is first time and stuck at how to create the predefined total in P&L statement, Shall I use measure or calculated column.

 

Also would request you please help with dax, I have mark the filed below for your refernce.

 

Thnaks in advance.

 

P&L.JPG

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

Hi @Anonymous ,

I created an original data table like this:
(Notice that the value in the last row is empty.)

a1.PNG

In Power BI , first I calculated the value of the last row with a column:

 

 

value of 'K+L-J' = 
VAR x=
CALCULATE(
    SUM(Sheet1[values]),
    FILTER(
        Sheet1,
        [Main title] = "Operating Profit-HG" || [Main title] = "Operating Profit-PAA" 
    )
)
VAR y =
CALCULATE(
    SUM( Sheet1[values]),
    FILTER(
        Sheet1,
        [Main title] = "Fixed Cost"
    )
)
RETURN
IF(
    [Main title] = "K+L-J",
    x-y,
    BLANK()
)

 

 

Second, I merged [values] column and [value of ‘K+L-J’] column with a column:

 

 

Column = 
IF(
    [values] = BLANK(),
    COMBINEVALUES("$", [value of 'K+L-J'], [values]),
    COMBINEVALUES("$", [values], [value of 'K+L-J'])
)

 

 

Third, Transform data type:

 

a3.PNG

At last, add column in a matrix:
a4.PNG

Best regards,
Lionel Chen

 

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
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

I created an original data table like this:
(Notice that the value in the last row is empty.)

a1.PNG

In Power BI , first I calculated the value of the last row with a column:

 

 

value of 'K+L-J' = 
VAR x=
CALCULATE(
    SUM(Sheet1[values]),
    FILTER(
        Sheet1,
        [Main title] = "Operating Profit-HG" || [Main title] = "Operating Profit-PAA" 
    )
)
VAR y =
CALCULATE(
    SUM( Sheet1[values]),
    FILTER(
        Sheet1,
        [Main title] = "Fixed Cost"
    )
)
RETURN
IF(
    [Main title] = "K+L-J",
    x-y,
    BLANK()
)

 

 

Second, I merged [values] column and [value of ‘K+L-J’] column with a column:

 

 

Column = 
IF(
    [values] = BLANK(),
    COMBINEVALUES("$", [value of 'K+L-J'], [values]),
    COMBINEVALUES("$", [values], [value of 'K+L-J'])
)

 

 

Third, Transform data type:

 

a3.PNG

At last, add column in a matrix:
a4.PNG

Best regards,
Lionel Chen

 

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