Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
So I have three columns of data called 'Page 1' 'Page 2' and 'Page 3'.
I want a Custom column to first look at Page 1 and if it doesn't contain the word "Test", Custom column should populate with the contents of Page 1.
If it does contain the word "Test", it should then look at Page 2.
If Page 2 is not blank then Custom column should populate with the content of Page 2.
If it is blank then Custom column should populate with the content of Page 3.
I have used the code below, but it's not working properly see attached where in red my logic isn't being applied. =
Table.AddColumn(#"Filtered/", "Custom", each if [Page 1] = "Test" then [Page 2] else if [Page 2] = null then [Page 3] else [Page 1])
Solved! Go to Solution.
Looks like your IF statement is evaluating in an order you aren't expecting. If Page 1 is not equal to test, the next logic it tries to apply is the if Page 2 = null logic.
Try this instead:
Table.AddColumn(#"Filtered/", "Custom", each
if [Page 1] = "Test" then
if [Page 2] = null then [Page 3]
else [Page 2]
else [Page 1]
)
Looks like your IF statement is evaluating in an order you aren't expecting. If Page 1 is not equal to test, the next logic it tries to apply is the if Page 2 = null logic.
Try this instead:
Table.AddColumn(#"Filtered/", "Custom", each
if [Page 1] = "Test" then
if [Page 2] = null then [Page 3]
else [Page 2]
else [Page 1]
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |