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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Anonymous
Not applicable

Power query if statement help

Can someone please help me with the error on the attached picture? It seems as though I'm missing something simple, but can seem to be able to get the syntax right. 

817599E9-EFA7-4EAD-98B6-C149FEB2AE0C.jpeg

1 ACCEPTED SOLUTION
nandic
Resident Rockstar
Resident Rockstar

@Anonymous , you have " sign on wrong place (in front of field name).
"[MRP Type]="ND" then ...
it should be
[MRP Type]="ND" then ...

 

Regards,

Nemanja Andic

View solution in original post

3 REPLIES 3
nandic
Resident Rockstar
Resident Rockstar

@Anonymous , you have " sign on wrong place (in front of field name).
"[MRP Type]="ND" then ...
it should be
[MRP Type]="ND" then ...

 

Regards,

Nemanja Andic

Anonymous
Not applicable

That was it! Can't believe I didn't catch that. Thank you!!

smpa01
Community Champion
Community Champion

@Anonymouscan you try it like this

if ([Index]=1 and [val]<>null) then 1 else if ([Index]>1 and [val]<>null) then 2 else 0

========================
Did I answer your question? Mark my post as a solution!
Proud to be a Super User
My Custom Visualization Projects
• Plotting Live Sound: Live Sound
• Beautiful News: Women in Parliament, Energy Mix, Shrinking Armies
• Visual Capitalist: Working Hrs
• Others: Easing Graph, Animated Calendar
MayViz Submissions
• Week 1: View
• Week 2: View
• Week 3: View
• Week 4: View
========================

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.