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

If then Else Statement

Hi,

 

I am in the process of converting Business Objects reports to Power BI.

 

This is the formula for Objects in BO.

=If(IsNull([Invoicenumber]);[Amountbase]-[Reconciled];0)

=If([Itemsumbase]-[Amountbase] Where ([Itemsumbase]+0>0)<0;0; [Itemsumbase]-[Amountbase] Where ([Itemsumbase]+0>0))

 

Can you please let me know how to create DAX on PBI? 

 

Thanks,

RS

 

 

1 REPLY 1
az38
Community Champion
Community Champion

Hi @Anonymous 

first statement looks easy

If(ISBLANK([Invoicenumber]);[Amountbase]-[Reconciled];0)

not sure I understand second correct but it should be similar here

=
var _ifStatement = CALCULATE(SUMX(Table; [Itemsumbase]-[Amountbase]); [Itemsumbase]>0)
RETURN
If(_ifStatement<0; 0; _ifStatement)

  


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.