Power Query added column - Value.Divide(Value.Add( )) returns all null values

astrbac

Board Regular
Joined
Jan 22, 2015
Messages
55
Hi all,


When I create a calculated field in Microsoft Power Query feature ("Get and Transform" since Excel 2016) I use a combination two simple formulae: Value.Divide() and Value.Add(). For some reason, this does not work and all I get is null values.

Here is the series of steps that I usually do:


  1. Get&Transform data from .csv;
  2. Arrange fields (columns) by dragging around, rename;
  3. Add some custom fields;
  4. Change field types as appropriate (if necessary);

The one giving me problems is as follows:

Code:
= Table.AddColumn(#"Add Cost per result", "ROAS", each Value.Divide(Value.Add([Website conversion value], [#"Mobile app purchases conversion value (corr.)"]), [#"Amount spent (GBP)"]))


Or, as copied from a "graphical interface":

Code:
= Value.Divide(Value.Add([Website conversion value], [#"Mobile app purchases conversion value (corr.)"]), [#"Amount spent (GBP)"])


How fields relevant for this formula appear in the Get&Transform window:


  • [Website conversion value] is imported from the original .csv;
  • [#"Mobile app purchases conversion value (corr.)"] is calculated field (via "Add column...");
  • [#"Amount spent (GBP)"] is imported from the original .csv (I suspect that this might be the problematic one - why does it have a # pre-pended when it was in the .csv originally, during the import? Isn't this a symbol # for a "table from previous step"?;


Many thanks! Alex
 
Last edited:

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
SOLVED!

It seems that the Power Query Value. formulae cannot work with null values. I replaced null values with a 0 (which is not the most correct thing to do but what can I do) and it worked! :)
 
Upvote 0

Forum statistics

Threads
1,223,881
Messages
6,175,159
Members
452,615
Latest member
bogeys2birdies

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