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
UB400
Regular Visitor

Splitting Column containing Debits and Credits

Hi all, I'm new to PowerBi and am currently working through the tutorials.

I have a Table that has a Debit/Credit Column with a Text value of C or D and another column which contains the related amount.

 

I would like to split these into two Columns, with Headers of "Debit" and "Credit" with the content of the Columns being the amount.

 

Currently

 

Date:  Description: Debit/Credit: Amount:
01/18 Invoice 001  Debit                 100

 

I want to change it to 

 

Date:  Description: Debit:  Credit:

01/18  Invoice         100

 

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION
shebr
Resolver III
Resolver III

Hi @UB400

 

In your query designer, (see image below) do the following:

 

1. Highlight your Credit/Debit column

2. Click on 'Pivot' in the ribbon above

3. Select 'Amount' in the values options

4. Click OK.

 

You should have the data in your required format. (See image 2) 

 

Let me know how you get on.

 

Thanks

 

shebr

 

pivot.JPGPivot 2.JPG

View solution in original post

3 REPLIES 3
shebr
Resolver III
Resolver III

Hi @UB400

 

In your query designer, (see image below) do the following:

 

1. Highlight your Credit/Debit column

2. Click on 'Pivot' in the ribbon above

3. Select 'Amount' in the values options

4. Click OK.

 

You should have the data in your required format. (See image 2) 

 

Let me know how you get on.

 

Thanks

 

shebr

 

pivot.JPGPivot 2.JPG

UB400
Regular Visitor

@shebr and @Greg_Deckler thank you both for responding, greatly appreciated. I'm just gobsmacked at how things are done in PowerBI. @shebr I would never have figured that one out, that is amazing, thank you. I have a lot of learning to do, and with the support that I'm receiving here, I'm looking forward to the journey

Greg_Deckler
Super User
Super User

I would do this in the Query Editor and add two Conditional Columns. Basically for Debit column, if the Debit/Credit column is "Debit", then Amount, otherwise null.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.