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.
I looking for a DAX expression or another way to create a "New Column" that returns the value from "Column 2" if "Column 1" value is 0 and value from
"Column 1" if "Column 2" is 0.
Any help would be great!
Column 1 | Column 2 | New Column | |
12 | 0 | 12 | |
0 | 43 | 43 | |
43 | 0 | 43 | |
0 | 22 | 22 | |
0 | 56 | 56 | |
54 | 0 | 54 | |
0 | 77 | 77 |
Solved! Go to Solution.
Hi,
Try this calculated column formula
=MAX(Data[Column 1],Data[Column 2])
Hope this helps.
Hi,
Try this calculated column formula
=MAX(Data[Column 1],Data[Column 2])
Hope this helps.
@CAT6xx
Use @az38 's DAX but remove "undefined", because it is text datatype, Column 1 and Column 2 are numerical numbers. I guess you would return an error of variant datatype.
New Column = SWITCH(TRUE(),
[Column 1] = 0, [Column 2],
[Column 2] = 0, [Column 1])
Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
58 | |
56 | |
56 | |
38 | |
29 |
User | Count |
---|---|
75 | |
62 | |
45 | |
40 | |
39 |