cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sjehanzeb
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. >

2 REPLIES 2
v-angzheng-msft
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

lbendlin
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

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power BI Dev Camp Session 27

Ted's Dev Camp

This session walks through creating a new Azure AD B2C tenant and configuring it with user flows and custom policies.