Forum Discussion
hcova7
1 year agoFrequent Visitor
How to modify some DAX measures to solve a Running Total problem
Dear sirs, Please your help for the following DAX measure problem. I have the following Excel pivot table: This Pivot Table is built from the following table called "Systems" ...
- 1 year ago
hcova7
Please try with this measure:RTotal_6 := VAR _CurrentDate = MAX( 'Calendar'[Date] ) VAR _StartDate = CALCULATE( MIN( 'Calendar'[Date] ); ALLSELECTED( 'Calendar' ) ) VAR _EndDate = CALCULATE( MAX( 'Calendar'[Date] ); ALLSELECTED( 'Calendar' ) ) VAR _Range = DATESBETWEEN( 'Calendar'[Date]; _StartDate; _CurrentDate ) VAR _RunningTotal = CALCULATE( SUMX( System; 'System'[ProfitUSD] ); _Range ) RETURN _RunningTotalI hope this help, if so please mark as a solution. Kudos are welcome๐
pcoley
Super User
1 year agohcova7
Please try with this measure:
RTotal_6 :=
VAR _CurrentDate =
MAX( 'Calendar'[Date] )
VAR _StartDate =
CALCULATE(
MIN( 'Calendar'[Date] );
ALLSELECTED( 'Calendar' )
)
VAR _EndDate =
CALCULATE(
MAX( 'Calendar'[Date] );
ALLSELECTED( 'Calendar' )
)
VAR _Range =
DATESBETWEEN(
'Calendar'[Date];
_StartDate;
_CurrentDate
)
VAR _RunningTotal =
CALCULATE(
SUMX(
System;
'System'[ProfitUSD]
);
_Range
)
RETURN
_RunningTotal
I hope this help, if so please mark as a solution. Kudos are welcome๐
hcova7
1 year agoFrequent Visitor
Thank you very much for your perfect solution. You don't know how much time I have been able to reduce with this measure. Warm regards