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
Giada90
Helper III
Helper III

problem with date

Hi,

I use a formula like this:

measure = calculate(sum(field),'table'[date]<=31/12/22)
If I use this formula it doesn't work, it seems it doesn't recognise date, how can I do?
The field date is in date format
quantitydate
101/03/22
207/03/22
320/04/22
520/3/23
83/4/23
1 ACCEPTED SOLUTION
DOLEARY85
Resident Rockstar
Resident Rockstar

Your measure would also work if you change the date of 31/12/22 to date(2022,12,31):

 

Measure 10 = calculate(sum('Table'[field]),'Table'[date]<=date(2022,12,31))
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

View solution in original post

2 REPLIES 2
DOLEARY85
Resident Rockstar
Resident Rockstar

Your measure would also work if you change the date of 31/12/22 to date(2022,12,31):

 

Measure 10 = calculate(sum('Table'[field]),'Table'[date]<=date(2022,12,31))
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

DOLEARY85
Resident Rockstar
Resident Rockstar

Hi 

 

try a calculated column with:

 

Column = if('Table'[date] <= date(2022,12,31),CALCULATE(sum('Table'[quantity])),0)
 
If I answered your question, please mark my post as solution, Appreciate your 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.