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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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