Power Query help

shophoney

Active Member
Joined
Jun 16, 2014
Messages
281
Hi,

I have a power query that lists all accounts per transaction.

But I need to know if the invoice was taxable. So if there are three lines being, PURCHASES, SHIPPING AND TAX. I want to know every transaction that has the TAX account.

Example this transaction doesn't have the tax account in the list. So it's non taxable on each line.

But if one of the accounts listed was TAX then I want the word tax on each line. Each line is the same document#.
1698623205434.png
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Dunno if this is what you are looking for but here is my attempt
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Vendor", type text}, {"Balance", type any}, {"Account", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "TaxC", each if [Account] = "Tax" then "Tax" else null ),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "AccountSor", each if[Account]="Tax" then 1 else if[Account]="Ship" then 2 else if[Account]="Pur" then 3 else 4),
    #"Sorted Rows" = Table.Sort(#"Added Custom1",{{"Vendor", Order.Ascending}, {"AccountSor", Order.Ascending}}),
    #"Filled Down" = Table.FillDown(#"Sorted Rows",{"TaxC"}),
    #"Replaced Value" = Table.ReplaceValue(#"Filled Down",null,"No Tax",Replacer.ReplaceValue,{"TaxC"})
in
    #"Replaced Value"

1698666642699.png
 
Upvote 0

Forum statistics

Threads
1,215,160
Messages
6,123,355
Members
449,097
Latest member
thnirmitha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top