The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have 4 numerical columns that i tried to add together by just putting a "+" between the field names using the wizard, but it just produces null values. the query is below
= Table.AddColumn(#"Changed Type7", "Custom", each [#"Exceptional Items pre GP#(lf)th GBP Last avail. yr"]+[#"Exceptional Items pre OP#(lf)th GBP Last avail. yr"]+[#"Exceptional Items#(lf)th GBP Last avail. yr"]+[#"Other Exceptional Items#(lf)th GBP Last avail. yr"])
However i found if I select the columns and use the statisitcs/sum function it works and query looks like this
= Table.AddColumn(#"Added Custom9", "Exceptionals", each List.Sum({ [#"Exceptional Items pre GP#(lf)th GBP Last avail. yr"],[#"Exceptional Items pre OP#(lf)th GBP Last avail. yr"],[#"Exceptional Items#(lf)th GBP Last avail. yr"],[#"Other Exceptional Items#(lf)th GBP Last avail. yr"]}),type number)
Can someone explain why just putting a "+" between field names doesn't work as sure i've used convetional mathematical operators before in custom columns?
Thanks for any advice
Mike
Solved! Go to Solution.
You might have null values in some columns
null + 10 = null in Power Query/M
But
List.Sum({10,null})=10
You might have null values in some columns
null + 10 = null in Power Query/M
But
List.Sum({10,null})=10
Yes lots of them. Thought a null was a blank, but there you go thanks for clarifyingi'm not doing somethig wrong
User | Count |
---|---|
84 | |
83 | |
34 | |
32 | |
32 |
User | Count |
---|---|
94 | |
79 | |
62 | |
54 | |
51 |