Forum Discussion
THEG72
Helper V
7 years agoCalculated Column with numeric field and text field
I have the following table data and would like to make a custom column that will have 2 possible outputs "Cash Inflow" or "Cash Outflow" as shown in the formula required section below. There are...
- 7 years ago
- 7 years ago
Hi,
This M code works
let Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content], #"Changed Type" = Table.TransformColumnTypes(Source,{{"Finance Group", type text}, {"Value", Int64.Type}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if [Finance Group]="Revenue" then if [Value]>0 then "Cash Inflow" else "Cash Outflow" else if [Value]<0 then "Cash Outflow" else "Cash Inflow") in #"Added Custom"Hope this helps.
ChandeepChhabra
Impactful Individual
7 years agoTHEG72 No it can't for now. What label do you want in-case it is a zero?
THEG72
Helper V
7 years agoChandeepChhabra I guess this is more for error logic and accounting for all the possibilities of the values. you could output "No Cashflow"