Forum Discussion
Find the last day value;
- 8 years ago
It seems you are modeling off a single table and created a second calculated table. If so, i would do things a bit differently. I would use measures instead. First, put 'id' and 'DT_COMPTC' on rows of Matrix, then add the following measures:
VL_Quota measure = SUM (Inf_diario[VL_Quota] )
then:
Previous VL Measure = VAR _dates = FILTER ( ALL ( Inf_diario[DT_COMPTC] ), Inf_diario[DT_COMPTC] < MAX ( Inf_diario[DT_COMPTC] ) ) VAR _previousDate = LASTNONBLANK ( _dates, [VL_Quota measure] ) RETURN CALCULATE ( [VL_Quota measure], Inf_diario[DT_CoMPTC] = _previousDate )then your % change is easy:
% Change = DIVIDE ( [Previous DL Measure] - [VL_Quota measure], [VL_Quota measure] )
and so on.
But if you want to continue to use your calculated table, you'll need to add more values via the ADDCOLUMNS you have.
It seems you are modeling off a single table and created a second calculated table. If so, i would do things a bit differently. I would use measures instead. First, put 'id' and 'DT_COMPTC' on rows of Matrix, then add the following measures:
VL_Quota measure = SUM (Inf_diario[VL_Quota] )
then:
Previous VL Measure =
VAR _dates =
FILTER (
ALL ( Inf_diario[DT_COMPTC] ),
Inf_diario[DT_COMPTC] < MAX ( Inf_diario[DT_COMPTC] )
)
VAR _previousDate =
LASTNONBLANK ( _dates, [VL_Quota measure] )
RETURN
CALCULATE ( [VL_Quota measure], Inf_diario[DT_CoMPTC] = _previousDate )then your % change is easy:
% Change = DIVIDE ( [Previous DL Measure] - [VL_Quota measure], [VL_Quota measure] )
and so on.
But if you want to continue to use your calculated table, you'll need to add more values via the ADDCOLUMNS you have.
- fleal8 years agoFrequent Visitor
It worked perfectly!!! Thank you mattbrice.