Forum Discussion
kadapavel
7 years agoHelper II
Rolling total since specific date
Hi, could you please help me to fix my measure. I would calculate rolling total since one specific date fatigue_test =
CALCULATE(
SUM('KPI_Indices'[Wearout with min damage]),
FILTER(
ALL(KP...
- Anonymous7 years ago
HI kadapavel ,
You can consider to add a if statement with conditions to compare current date and specific date:
POwer bi DAX = VAR currDate = MAX ( 'Sheet1'[ResultDate] ) VAR selected = 'specific datevalue' RETURN CALCULATE ( SUM ( 'Sheet1'[Result] ), FILTER ( ALL ( Sheet1 ), IF ( currDate < selected, 'Sheet1'[ResultDate] <= currDate, 'Sheet1'[ResultDate] >= selected && 'Sheet1'[ResultDate] <= currdate ) ) )Regards,
Xiaoxin Sheng
kadapavel
7 years agoHelper II
Hi, I was not able to attach PBIX file,
here is a snapshot of data, days result and cumulative total. Last column[I want this result] is that what I want and have built with excel. [Power bi DAX] is a measure where I have a challenge.
POwer bi DAX =
CALCULATE(
SUM('Sheet1'[Result]),
FILTER(
ALL(Sheet1[ResultDate]),
'Sheet1'[ResultDate] <= MAX('Sheet1'[ResultDate])))BR
Pavel
Anonymous
7 years agoNot applicable
HI kadapavel ,
You can consider to add a if statement with conditions to compare current date and specific date:
POwer bi DAX =
VAR currDate =
MAX ( 'Sheet1'[ResultDate] )
VAR selected = 'specific datevalue'
RETURN
CALCULATE (
SUM ( 'Sheet1'[Result] ),
FILTER (
ALL ( Sheet1 ),
IF (
currDate < selected,
'Sheet1'[ResultDate] <= currDate,
'Sheet1'[ResultDate] >= selected
&& 'Sheet1'[ResultDate] <= currdate
)
)
)
Regards,
Xiaoxin Sheng
- kadapavel7 years agoHelper II
Hi v-shex-msft,
Perfect!!! Thank you, it works.
Regards
Pavel