Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

IF Statement in Power Query

Hi Experts,

 

What's wrong with my statement? Why is throwing me an error?

 

Anyone, Please help

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Its working Now

    if [CIR_WT_TYPE]= "SL" then ([ANF_WT]-[CIR_WT])/1000 else if[CIR_WT_TYPE]= "OL" then ([MANF_WT]+[CIR_WT])/1000
    else if[CIR_WT_TYPE]= "SP" then ([MANF_WT]+[CIR_WT])/1000
    else [MANF_WT]/1000)

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Its working Now

    if [CIR_WT_TYPE]= "SL" then ([ANF_WT]-[CIR_WT])/1000 else if[CIR_WT_TYPE]= "OL" then ([MANF_WT]+[CIR_WT])/1000
    else if[CIR_WT_TYPE]= "SP" then ([MANF_WT]+[CIR_WT])/1000
    else [MANF_WT]/1000)

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ryan_mayu 
    Its not working, This is my latest error. 

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ryan_mayu ,

     

    I am still facing the same error, I need to do this only in Power Query. I have attached the PBIX file in the link, Below is my requirement. Please help me if Possible!

     

    Add Custom Column on the below criteria

    Spoiler
     

    if(CIR_WT_TYPE='SL',(MANF_WT-CIR_WT)/1000,
    if(CIR_WT_TYPE='OL',(MANF_WT+CIR_WT)/1000,
    if(CIR_WT_TYPE='SP',(MANF_WT+CIR_WT)/1000,MANF_WT/1000))) as Total_Tonnage


     

     Link to Download PBIX : https://1drv.ms/u/s!AsE8HLBpjnjdpm0wxg5IZqh4F4Yb