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
Bakhtawar
Post Patron
Post Patron

Sum expression in dax

Hi all 

 

I am trying to do this expression but this shows an error 

 

expression .. 

 
vMotor_Paid = CALCULATE(Paid_excel,SUM(Paid_excel[PAID_AMOUNT]),Paid_excel[Flag]="Paid"
,Premium_Excel[LOB]="MOTOR",Paid_excel[PAID_DATE]={[VpeDate]})
error
A function 'SUM' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
 
in expression i am trying to do SUM OF paid_amount against filters of these
Paid_excel[Flag]="Paid",Premium_Excel[LOB]="MOTOR",Paid_excel[PAID_DATE]={[VpeDate]}
here i create another varaible of VPeDate where i fixed the date "23-12-2017"
 
 
any help 
 
5 REPLIES 5
Stachu
Community Champion
Community Champion

The first Paid_excel is not necessary, try this:

vMotor_Paid =
CALCULATE (
    SUM ( Paid_excel[PAID_AMOUNT] ),    //first argument is always the expression
    Paid_excel[Flag] = "Paid",
    Premium_Excel[LOB] = "MOTOR",
    Paid_excel[PAID_DATE] = { [VpeDate] }
)

in your syntax SUM is considered a filter expression



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

hi when i try your expression this shows an error 

 

Capture.PNG

Stachu
Community Champion
Community Champion

have you made any modifications to the code, e.g. adjusting table names etc.?

is the error in the measure I posted or do you use it later and the dependant measure is giving the error?



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

No i did not do any modifications

Stachu
Community Champion
Community Champion

Is it the measure I posted that gives the error, or one that is using it later?


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

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.