Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

ifelse statement in DAX

I am trying to create a calculated column using the code below. Lookup function works find until I added the IF statement above it. What I need is to fix the outcome to 1 when df[col] = "B0" or df[col] = "B1" otherwise outcome should give the lookup function result. how to get around with this ? many thanks in advance.

_FY23_AOP_Rate = 
 IF('df'[col] = "B0" || 'df'[col] = "B1", 
    1, 
    LOOKUPVALUE(
                    dimFX[FY23 AOP], 
                    dimFX[Currency Code], 'df'[Currency])
  
)

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Are you just missing an enclosing quote after B1?

IF('df'[col] = "B0" || 'df'[col] = "B1", 
    1, 
    LOOKUPVALUE(
                    dimFX[FY23 AOP], 
                    dimFX[Currency Code], 'df'[Currency])
  
)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading