Forum Discussion
bhargavanand
Helper I
2 years agofill column based on other column values
Hi, I have two columns which Code and Names. I want to add a calculated column which should be assigned a number based on a condition that if Code = A and Name = B then 1, if Code = C and Name ...
- 2 years ago
CalculatedColumn = SWITCH( TRUE(), 'Table'[Code] = "A" && 'Table'[Names] = "B", 1, 'Table'[Code] = "C" && 'Table'[Names] = "D", 2, 'Table'[Code] = "E" && 'Table'[Names] = "F", 3, 'Table'[Code] = "G" && 'Table'[Names] = "H", 4, BLANK() )If your requirement is solved, please make THIS ANSWER a SOLUTION โ๏ธ and help other users find the solution quickly. Please hit the LIKE ๐ button if this comment helps you.
foodd
Community Champion
2 years ago
CalculatedColumn =
SWITCH(
TRUE(),
'Table'[Code] = "A" && 'Table'[Names] = "B", 1,
'Table'[Code] = "C" && 'Table'[Names] = "D", 2,
'Table'[Code] = "E" && 'Table'[Names] = "F", 3,
'Table'[Code] = "G" && 'Table'[Names] = "H", 4,
BLANK()
)
If your requirement is solved, please make THIS ANSWER a SOLUTION โ๏ธ and help other users find the solution quickly. Please hit the LIKE ๐ button if this comment helps you.