Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

IF Statement in Power Query

Hi Experts,

 

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

 

Anyone, Please help

Purushothaman_0-1646039200465.png

 

1 ACCEPTED SOLUTION
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)

View solution in original post

5 REPLIES 5
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
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


Purushothaman_0-1646055664178.png

 

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

 

Anonymous
Not applicable

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

Purushothaman_0-1646046471213.png

 

@Anonymous 

pls see the screenshot below

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

@Anonymous 

pls try 

if ... then ...else if....





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.