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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
kylee_anne
Helper II
Helper II

Calculate using date filter

Hi,

 

I'm trying to this:

kylee_anne_0-1731560220027.png

But I can't and don't understand why.

 

I'm trying to sum to a certain reporting date which changes and so can't be hard coded.

This is the DAX I have for it:

kylee_anne_1-1731560378213.png

So what am I missing?  All help appreciated.

1 ACCEPTED SOLUTION
Uzi2019
Super User
Super User

Hi @kylee_anne 

 

Try this,

 

Calculate( Sum ( Sales), Filter ( 'Table', 'Table'[Date]= Max( 'Table'[Date]))

 

I hope I answered your question!

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

2 REPLIES 2
FreemanZ
Community Champion
Community Champion

 
It is not allowed to reference a measure in a predicate filter argument - a simple equation. We need to write in its complete form with FILTER. 
 
try like:
Earned =
CALCULATE(
    SUM(data[hours]),
    FILTER(
        data, 
        data[date] = [Reporting Period]
    )
)

Uzi2019
Super User
Super User

Hi @kylee_anne 

 

Try this,

 

Calculate( Sum ( Sales), Filter ( 'Table', 'Table'[Date]= Max( 'Table'[Date]))

 

I hope I answered your question!

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

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.