Forum Discussion
cardonasebast
10 years agoFrequent Visitor
Running Values with Month and Value
Hi. I have a problem creating a Running Value in DAX. I need to group by month and value (for this case a Project) but most of the solutions in the community forum are releated to grouping by da...
- 10 years ago
Hi there,
For a running total in a DAX calculated column, I find the safest way is to use ALLEXCEPT to ensure that only the columns you specify remain in the filter context for each running total.
In your case I would use:
AcumT = CALCULATE ( SUM ( PptoxMes[Presupuesto] ); ALLEXCEPT ( PptoxMes; PptoxMes[Año]; PptoxMes[Projecto] ); PptoxMes[Month_Num] <= EARLIER ( PptoxMes[Month_Num] ) )Does that do the trick?
Owen :)
- 10 years ago
cardonasebast Look at the picture... Both of my formulas are Measures.
EDIT: You should probably add the Year field in the Matrix like this... so data is not aggregated by Month for all years
OwenAuger
10 years agoSuper User
Hi there,
For a running total in a DAX calculated column, I find the safest way is to use ALLEXCEPT to ensure that only the columns you specify remain in the filter context for each running total.
In your case I would use:
AcumT =
CALCULATE (
SUM ( PptoxMes[Presupuesto] );
ALLEXCEPT ( PptoxMes; PptoxMes[Año]; PptoxMes[Projecto] );
PptoxMes[Month_Num] <= EARLIER ( PptoxMes[Month_Num] )
)Does that do the trick?
Owen :)