Showing results for 
Search instead for 
Did you mean: 
Resolver I
Resolver I

Merging Data from two rows to one row in DAX (not M Query)

I am building an accounting dashboard, part of it is a Balance sheet. One of the columns in the Balance sheet. Balance sheet items are called categories. The difference values generated are

  • revenue = sum of values in revenue category
  • expense = sum of values in the expense category
  • profit  = a calculated measure showing the profit for the period. (revenue - expense)
  • surplus = profit from previous periods (basically retained income) - through in from the source data

In the Retained Income category of Balance sheet, it should suplus from the previous period + profit for the period 


when I try to show profit for the period, it shows all the categories of expense and revenue. what i want is that the

modified surplus should show both the values of surplus and profit in the same row. basically adding the values generated from profit to surplus (which already has an amount)


basically changing the row values on the fly. >

Community Support
Community Support

Hi, @sjehanzeb 


As a general advise, please, provide:


  1. Sample (dummy dataset) data as text, use the table tool in the editing bar
  2. Expected output from sample data
  3. Explanation in words of how to get from 1. to 2.

No need to show real data, you can always create some short dummy dataset to illustrate your issue so that we may work out with a workaround


How to provide sample data in the Power BI Forum

Super User
Super User

If you need calculated tables or columns then you can equally do the transform in M.  Only measures are something you cannot do in M.


Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.

Helpful resources

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors