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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. 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.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.