Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

375
Visualizações
If statement based on the concat in Power Bi

I have 4 columns are A,B,C and D. Those 4 columns are contain number and text or number or text.

If column A&B and C&D are matched then return "Ok" and if column A&B and C&D are not matched then return "No" and if column A&B or C&D are blanks then return "Blanks".

I am achieved my desired result by using duplicate column (A&B , C&D) but I want the same result without duplication columns.

A&B = 'DATA2'[A]&"-"&'DATA2'[B]

C&D = 'DATA2'[C]&"-"&'DATA2'[D]

RESULT = IF(DATA2[A&B]="-","NO",IF(DATA2[C&D]="-","NO", IF(DATA2[A&B] = DATA2[C&D],"OK","NO")))

I am attempted one more DAX for formula but that one also giving error "Cannot convert value 'AA1' of type Text to type Number".

RESULT 1 = CALCULATE( IF ( SUMX( 'DATA2', 'DATA2'[A]+'DATA2'[B]+'DATA2'[C]+'DATA2'[D])>0,0,1 ))

I am looking for New calculated column option.

Any help much appreciated.

Data:

A   B   C   D   DESIRED RESULT
AA1 TT1 DD1 XX1 NO
AA1 TT1 DD1 XX1 NO
AA1 TT1 DD1 XX1 NO
AA1 TT1 DD1 XX1 NO
AA1 TT1 DD1 XX1 NO
AA1 TT1 DD1 XX1 NO
AA1 TT2 DD1 XX2 NO
AA1 TT2 DD1 XX2 NO
AA1 TT2 DD1 XX2 NO
AA1 TT2 DD1 XX2 NO
AA1 TT2 DD1 XX2 NO
BB1 RR1 DD1 XX3 NO
BB1 RR1 DD1 XX3 NO
BB1 RR1 DD1 XX3 NO
BB1 RR1 DD1 XX3 NO
BB1 RR2 GG1 HH1 NO
BB1 RR2 GG1 HH2 NO
BB1 RR2 GG1 HH3 NO
                NO
                NO
                NO
                NO
BB1 RR2 BB1 RR2 OK

enter image description here

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

This is how I would solve it:

Result = 
var AB = [A]&[B]
var CD = [C]&[D]

return  
SWITCH(
    TRUE(),

    // Blank return if both AB and CD are blank/null
    (ISBLANK(AB) || AB = "") && (ISBLANK(CD) || CD = ""), BLANK(), 

    // A1 return if AB or CD (but not both) are blank
    (ISBLANK(AB) || AB = "") || (ISBLANK(CD) || CD = ""), "A1",

    // OK return if AB = CD
    AB = CD, "OK",

    // Catch all remaining cases with NO
    "NO"
)
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda