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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

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.