Forum Discussion
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
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()))
2 Replies
- Ritaf1983Super 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
- AllanBercesPost Prodigy
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()))