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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

M language if statement

Hi,

 

I am trying to do a IF statement in M language.

 

= if [vat] = "v7" then ([total] *1.2)-[total] else if [vat] = "4" then ([total] *1.05) -[total] 

I am getting a toke else error...

 

Any help.

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Figured it out.. it needs to have an else at the end otheriwse it doesnt work

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Figured it out.. it needs to have an else at the end otheriwse it doesnt work

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.