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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

syntax Error - Filter = Hitting head

Hi All, 

 

I am trying to write a Measure that converts seconds to hours and then filters by date updated in the last 30 days.

So far I am getting a syntax error on the filter and no matter what I try it just keeps failing.

Any suggestions welcomed:

 

Measure 3 = CALCULATE(SUM('CD'[Column1.fields.timeestimate] ) /3600)
FILTER(((CD[Column1.fields.updated.1]),'CD'[Column1.fields.updated.1] >= TODAY() - 30)
 
 
1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Try this:

Measure 3 =
CALCULATE (
    SUM ( 'CD'[Column1.fields.timeestimate] ) / 3600,
    DATESINPERIOD (
        CD[Column1.fields.updated.1],
        LASTDATE ( CD[Column1.fields.updated.1] ),
        -30,
        DAY
    )
)

measure1.PNGmeasure2.PNG
Best Regards
Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Try this:

Measure 3 =
CALCULATE (
    SUM ( 'CD'[Column1.fields.timeestimate] ) / 3600,
    DATESINPERIOD (
        CD[Column1.fields.updated.1],
        LASTDATE ( CD[Column1.fields.updated.1] ),
        -30,
        DAY
    )
)

measure1.PNGmeasure2.PNG
Best Regards
Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

d_gosbell
Super User
Super User

So your brackets are not matching. You've closed the CALCULATE before the FILTER and there is an extra opening bracket on the FILTER() call that does not have a matching closing bracket.

 

Also you can't do a filter directly on a column you need to filter a table or a table expression, so you'd need to wrap the reference to CD[Column1.fields.updated.1] at the start of your Filter expression in something like ALL() or VALUES()

 

So hopefully the following should work:

Measure 3 = CALCULATE(SUM('CD'[Column1.fields.timeestimate] ) /3600,
FILTER( ALL(CD[Column1.fields.updated.1]),'CD'[Column1.fields.updated.1] >= TODAY() - 30))

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.