Forum Discussion

michaelrlas's avatar
michaelrlas
New Member
2 years ago
Solved

having a issue using operator AND with operator OR to create a calculate column

Hello i have just one database and need to create a graphic using values with accounts paid off and open accounts, but to identify then i need that on a column (open or paid of) choose open, in another collumn (counts to pay or counts to receive) and in another column choose some codes realted like 8, 16 and 999. So i tried using if and shortcuts && to AND and || to OR and didnt workout.
until here its ok

crcab = IF('ms_hippo titulos01'[titulo]="CONTAS A RECEBER"&&'ms_hippo titulos01'[abertoquitado]="A",'ms_hippo titulos01'[Precoaj2],0)
 
but when i try to add the OR operator its not working
 
crcab = IF('ms_hippo titulos01'[titulo]="CONTAS A RECEBER"&&'ms_hippo titulos01'[abertoquitado]="A"&&'ms_hippo titulos01'[codoperacao]=8||'ms_hippo titulos01'[codoperacao]=16||'ms_hippo titulos01'[codoperacao]=999,'ms_hippo titulos01'[Precoaj2],0)

 

Can you guys help me?

  • michaelrlas I think:

    crcab = IF('ms_hippo titulos01'[titulo]="CONTAS A RECEBER"&&'ms_hippo titulos01'[abertoquitado]="A"&& ( 'ms_hippo titulos01'[codoperacao]=8||'ms_hippo titulos01'[codoperacao]=16||'ms_hippo titulos01'[codoperacao]=999 ),'ms_hippo titulos01'[Precoaj2],0)

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    michaelrlas I think:

    crcab = IF('ms_hippo titulos01'[titulo]="CONTAS A RECEBER"&&'ms_hippo titulos01'[abertoquitado]="A"&& ( 'ms_hippo titulos01'[codoperacao]=8||'ms_hippo titulos01'[codoperacao]=16||'ms_hippo titulos01'[codoperacao]=999 ),'ms_hippo titulos01'[Precoaj2],0)