Forum

Converting Values f...
 
Notifications
Clear all

Converting Values from positive to Negative in Power Query

5 Posts
3 Users
0 Reactions
1,489 Views
(@panimi8)
Posts: 7
Active Member
Topic starter
 

Hi Mynda, 

I want to know the best way to change my cell values in my "Revenue" column (as they are more of a contra asset account) using power query, in a dynamic enough way for when bring the new data for each month. Right now my data has more or less the following columns month/account/description/revenue/expenses/COGS.

I have a uploaded a quick sample data and I highlighted the data yellow that needs to be negative.

 

Thanks, 

Michael P.

 
Posted : 29/03/2023 10:52 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Michael,

You can check the Description column for words that indicate the value in the Revenue column should be negative, e.g. look for "Discounts" or "Allowance".  

If you find one of those words then multiply the value by -1.

See attached file.

Regards

Phil

 
Posted : 30/03/2023 12:25 am
(@panimi8)
Posts: 7
Active Member
Topic starter
 

Hi Philip, 

 

Thanks for the quick reply. I agree but I would rather do it where the account is ##, that revenue cell should be multiplied by -1. However I don't know the M language to do that. 

Thanks, 

Michael P. 

 
Posted : 30/03/2023 12:45 am
Riny van Eekelen
(@riny)
Posts: 1186
Member Moderator
 

I took Phil's file and added a table listing the negative revenue accounts and used that to identify the revenue numbers to be changed. All was done by clicking in the user interface and adding a straight-forward custom column. No complicated M-coding needed.

 
Posted : 30/03/2023 1:35 am
(@panimi8)
Posts: 7
Active Member
Topic starter
 

Very helpful. Thank you both.

 
Posted : 30/03/2023 9:39 pm
Share: