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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Midhun
Regular Visitor

Not able to select column when using earlier function

Hello Experts,

       I am tryiting to find the cumulative sum . when using below code i was not able to chse my column after earlier function. Please suggest

cumulative= CALCULATE(SUM(Email_Campaign[valid]),
all(Email_Campaign),Email_Campaign[Dummy_Date]<=EARLIER(
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Midhun ,

 

EARLIER function is useful to calculated column. Please check whether you are using it for measure.

 

You can use MAX function instead of EARLIER.

 

cumu = CALCULATE(
sum(Email_Campaign[Valid_Email]),
FILTER(
ALL( Email_Campaign[Dummy_Date] ),
Email_Campaign[Dummy_Date] <= MAX(Email_Campaign[Dummy_Date])
)
)

 

 

Best Regards,

Stephen Tao

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @Midhun ,

 

EARLIER function is useful to calculated column. Please check whether you are using it for measure.

 

You can use MAX function instead of EARLIER.

 

cumu = CALCULATE(
sum(Email_Campaign[Valid_Email]),
FILTER(
ALL( Email_Campaign[Dummy_Date] ),
Email_Campaign[Dummy_Date] <= MAX(Email_Campaign[Dummy_Date])
)
)

 

 

Best Regards,

Stephen Tao

 

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

 

Midhun
Regular Visitor

I tried with your DAX, still facing an issue. stating that

ARLIER/EARLIEST refers to an earlier row context which doesn't exist.

 

cumu = CALCULATE(
sum(Email_Campaign[Valid_Email]),
FILTER(
ALL( Email_Campaign[Dummy_Date] ),
Email_Campaign[Dummy_Date] <= EARLIER(Email_Campaign[Dummy_Date])
)
)
CNENFRNL
Community Champion
Community Champion

DAX engine interprets this filter modifier

 CALCULATE( ... Email_Campaign[Dummy_Date] <= EARLIER( Table[someColumn] ) )

as

= CALCULATE(
    ...,
    FILTER(
        ALL( Email_Campaign[Dummy_Date] ),
        Email_Campaign[Dummy_Date] <= EARLIER( Table[someColumn] )
    )
)

and FILTER( ... ) evaluates under the filter context outside CALCULATE(); obviously, there's no row context avaible for EARLIER.

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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