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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
DeepakJha23
Helper I
Helper I

Row level calculation

Hi PBI Community,

I have a data table that contains the following row items :

DeepakJha23_0-1715008669764.png

I want to populate the row items as below :

DeepakJha23_1-1715008794638.png

 Net Sales is a calculated row which is calculated as Sales - Adjustments, 
Gross Profit is calculated as Net Sales - Cost of Goods
and Operating Income is calculated as Gross Profit - Admin Expenses.

Any help on this is appreciated.

@amitchandak @Ashish_Mathur   @Ritaf1983  @parry2k @MFelix 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,@DeepakJha23 .
I am glad to help you.

According to your description, you want to realise the Row level calculation.

Here is my test.

vjtianmsft_0-1715050514828.png

You can create the following DAX function to do what you want.

 

Net Sales = 'Table'[Sales]-'Table'[Adjustments] 
Gross Profit = 'Table'[Net Sales]-'Table'[Cost of Goods]
Operating Income = 'Table'[Gross Profit]-'Table'[Admin Expenses]

 

You can then use these calculated columns after that.
However, if you want to implement calculations between rows for each object property, you can use transposition, where you need to redefine new columns based on the previous column names to display the column names of the table before transposition. But this will invalidate the previously created calculated columns.
You could try to use the calculate function to calculate the data by limiting the scope of the calculation (but here, after transposition, the data from the previous different columns are now grouped into one column based on the object).

Here is the data after transposition.

vjtianmsft_1-1715050583348.pngvjtianmsft_2-1715050590737.png

In my opinion ,this is not good for the user to manage the data, so I recommend you to use calculated columns for your data calculations.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
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,@DeepakJha23 .
I am glad to help you.

According to your description, you want to realise the Row level calculation.

Here is my test.

vjtianmsft_0-1715050514828.png

You can create the following DAX function to do what you want.

 

Net Sales = 'Table'[Sales]-'Table'[Adjustments] 
Gross Profit = 'Table'[Net Sales]-'Table'[Cost of Goods]
Operating Income = 'Table'[Gross Profit]-'Table'[Admin Expenses]

 

You can then use these calculated columns after that.
However, if you want to implement calculations between rows for each object property, you can use transposition, where you need to redefine new columns based on the previous column names to display the column names of the table before transposition. But this will invalidate the previously created calculated columns.
You could try to use the calculate function to calculate the data by limiting the scope of the calculation (but here, after transposition, the data from the previous different columns are now grouped into one column based on the object).

Here is the data after transposition.

vjtianmsft_1-1715050583348.pngvjtianmsft_2-1715050590737.png

In my opinion ,this is not good for the user to manage the data, so I recommend you to use calculated columns for your data calculations.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
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 is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

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.