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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.