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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
HamidBee
Power Participant
Power Participant

Why is this conditional DAX expression giving me an error?

I have a table called 'Parking Data' and a column called 'Payment Total Amount'. I have null values in the column and I'd like to replace those null values with 0. I used the following DAX:

 

 

Parking Total Amount = IF(ISBLANK(SUM('Parking Data'[Payment Amount Total])), 0, SUM('Parking Data'[Payment Amount Total]]))

 

 

But when I press Enter, Power BI adds two additional parenthesis at the end of the expression like so:

 

Parking Total Amount = IF(ISBLANK(SUM('Parking Data'[Payment Amount Total])), 0, SUM('Parking Data'[Payment Amount Total]]))))

 

 

and gives me the following error:

 

 

The end of the input was reached.

 

 

Here is an image:

 HamidBee_0-1660368831714.png

 

1 ACCEPTED SOLUTION
HamidBee
Power Participant
Power Participant

I'm still getting the same error unfortunately. But this worked:

 

Parking Total Amount = IF(ISBLANK(SUM('Parking Data'[Payment Amount Total])), 0, SUM('Parking Data'[Payment Amount Total]))

 

View solution in original post

4 REPLIES 4
AlexisOlson
Super User
Super User

You have two square brackets at the end of the last column. Take out the extra one and it should be fine.

 

Parking Total Amount =
IF (
    ISBLANK ( SUM ( 'Parking Data'[Payment Amount Total] ) ),
    0,
    SUM ( 'Parking Data'[Payment Amount Total] )
)

 

Using a variable is cleaner:

Parking Total Amount =
VAR _PayTotal =
    SUM ( 'Parking Data'[Payment Amount Total] )
RETURN
    IF ( ISBLANK ( _PayTotal ), 0, _PayTotal )

 

You still make it simpler using COALESCE

Parking Total Amount = COALESCE ( SUM ( 'Parking Data'[Payment Amount Total] ), 0 )
ddpl
Solution Sage
Solution Sage

@HamidBee try this

 

Parking Total Amount = IF(SUM('Parking Data'[Payment Amount Total]) = Blank(),0, SUM('Parking Data'[Payment Amount Total]]))
HamidBee
Power Participant
Power Participant

I'm still getting the same error unfortunately. But this worked:

 

Parking Total Amount = IF(ISBLANK(SUM('Parking Data'[Payment Amount Total])), 0, SUM('Parking Data'[Payment Amount Total]))

 

@HamidBee  you can  use Variable as per below

 

Parking Total Amount = Var Totalpayment =
                       SUM('Parking Data'[Payment Amount Total])
               RETURN
                    IF([Totalpaymnet] = BLANK(),0,[Totalpayment])

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors