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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
AllanBerces
Post Prodigy
Post Prodigy

Less than or equal Today

Hi good day, can anyone help me correct my calculated column. what i required is there should be no value beyond <= Today

 

**bleep** Earned = CALCULATE(
    SUM('table'[Earned]),
    FILTER(
        ALL('table'),
        'table'[Task] = EARLIER('table'[Task]) &&
        'table'[Trade] = EARLIER('table'[Trade] ) &&
        'table'[PlanDate] <= EARLIER('table'[PlanDate])
       
    )
)
 
Thank you
1 ACCEPTED SOLUTION

Hi @Ritaf1983 thank you very much for the reply i got the solution

**bleep** Earned = CALCULATE(
    SUM('table'[Earned]),
    FILTER(
        ALL('table'),
        'table'[Task] = EARLIER('table'[Task]) &&
        'table'[Trade] = EARLIER('table'[Trade] ) &&
        'table'[PlanDate] = EARLIER('table'[PlanDate]) &&
         [PlanDate] <= TODAY()
  )
)

View solution in original post

2 REPLIES 2
Ritaf1983
Super User
Super User

Hi @AllanBerces 
Your current DAX formula calculates a Running Total (grouped by Task and Trade), which doesn't seem to align with your request to limit values based on today's date.

To help you fix this, a few points need clarification:

Logic Mismatch: There is no reference to TODAY() in your code. To limit values, you simply need a comparison like 'table'[PlanDate] <= TODAY().

Calculated Column Context: Why are you using an aggregation (SUM) and row-context navigation (EARLIER) if the goal is a simple filter? If you just want to display the value of the current row based on a date condition, you don't need CALCULATE or SUM.

Best Practice: EARLIER is considered legacy DAX. It is better to use Variables (VAR) for better readability and performance.

To provide a correct solution, please share:

A small sample of your source table.

An example of the expected result you want to see in the new column.

This will clarify if you actually need a running total that stops at today, or just a simple row-level check.

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi @Ritaf1983 thank you very much for the reply i got the solution

**bleep** Earned = CALCULATE(
    SUM('table'[Earned]),
    FILTER(
        ALL('table'),
        'table'[Task] = EARLIER('table'[Task]) &&
        'table'[Trade] = EARLIER('table'[Trade] ) &&
        'table'[PlanDate] = EARLIER('table'[PlanDate]) &&
         [PlanDate] <= TODAY()
  )
)

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors