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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Bakhtawar
Post Patron
Post Patron

Store fixed date in variable

Hi all 

i write this expression and there is not any errors in this 

vMotor_Paid = CALCULATE(SUM(Paid_excel[PAID_AMOUNT]),FILTER(Paid_excel[PAID_DATE]={[VpeDate]}))

Here I create another variable of VpeDate and store date like this "12-03-2017" (mm-dd-yyyy) 

 

now on KPI card when i drag this vMotor_Paid expression this shows an error 

 

"Calculation error in measure 'Varaibles Table'[vMotor_Paid: DAX comaprison operations do not support 

comparing values of type Date with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values "

2 REPLIES 2
Stachu
Community Champion
Community Champion

try this syntax:

vMotor_Paid =
CALCULATE (
    SUM ( Paid_excel[PAID_AMOUNT] ),
    FILTER ( Paid_excel, Paid_excel[PAID_DATE] = { [VpeDate] } )
)


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

Hi when i try to add more filters this shows nothing  i tried this 

vMotor_Paid = 
CALCULATE (
    SUM ( Paid_excel[PAID_AMOUNT] ),
    FILTER ( Paid_excel, Paid_excel[PAID_DATE] = { [VpeDate] } ),
FILTER(Premium_Excel,Premium_Excel[LOB] = "MOTOR"),
FILTER(Paid_excel,Paid_excel[Flag] = "Paid"))

and in VpeDate i add date like this 

VpeDate = date(2017,12,31)

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.