Forum Discussion
Creating a conditional column with null value
A couple questions/comments:
1 - When creating a calculated column, the table name isn't necessary.
2 - I'm not sure where you came up with Sheet186[Column].
3 - While I realize SWITCH has its places, please explain how in a simple case like this it easier to read than using IF.
grantsamborn =
IF(
ISBLANK( [ColumnA] ),
IF(
ISBLANK( [ColumnB] ),
[ColumnC],
[ColumnB]
),
[ColumnA]
)
MahyarTF =
SWITCH(
Sheet186[Column],
BLANK(),
SWITCH(
Sheet186[A],
BLANK(),
SWITCH(
Sheet186[B],
BLANK(), Sheet186[C],
Sheet186[B]
),
Sheet186[A]
),
Sheet186[Column]
)Hi,
1- Yes, You are right, for the calc column not need to bring the table name (as in the sample file, I have a multi same columns, I wrote the table name and just copy the code)
2- my Table structure is like below (I bring one more column ) :
3- As you know there is more than one solution. I mentioned that your answer I good, but sometimes the codes' performance should be considered.
As you see in below image I run the codes for comparing the performance and it should be not same (should check in real data by user to find the best solution :
Thanks for letting me know
- grantsamborn3 years agoSolution Sage
This is the first I've heard of a sample file.
Good luck.
- grantsamborn3 years agoSolution Sage
Correct me if I am wrong, but I believe calculated columns are only calculated on refresh of the dataset - NOT on the refresh of visuals.
- danextian3 years agoSuper User
That is correct. Or also upon editing the calculated column.