Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I am having a strange problem in the query editor (in Power BI). I want to add a new column that is the SUM of two columns in the same table:
It's really strange, if the formula for PASok is just a SUM of the other 2 columns that have some values, how can the new column only return null values? any idea what can be going on here?
Thank you very much
Solved! Go to Solution.
The + operator is returning a null because the [PAS] field is null ( number + null = null). This behavior is standard for all operators within PQ (+,-,/,*) and sql. You can override this behavior with List.Sum. List.Sum ignores nulls by definition.
List.Sum( { [Services Proactive], [PAS] } )
This could be achieved simply by coalesce operator ??
let
Source = #table(type table[A=number, B=nullable number], List.Zip({ List.Transform(List.Random(20,1), each Number.Round(_, 2) * 100) , List.Repeat({null}, 20) })),
Ad_Sum = Table.AddColumn(Source, "Sum", each [A] + ([B] ?? 0), type number)
in
Ad_Sum
The + operator is returning a null because the [PAS] field is null ( number + null = null). This behavior is standard for all operators within PQ (+,-,/,*) and sql. You can override this behavior with List.Sum. List.Sum ignores nulls by definition.
List.Sum( { [Services Proactive], [PAS] } )
Thanks!
Ok, thank you very much.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
17 | |
9 | |
8 | |
7 | |
7 |