Forum Discussion
wpf_
Post Prodigy
6 years agoHow to reset a measure value?
How do you set a one measure to a different value in different measure? For example in the below measure:
Measure =
If( CALCULATE([count]) = 3,
SUMX(VALUES(Table[Direction]), CALCULATE([Travel Times])),
BLANK()
)
How can i set [count] = 0 both when condition is true and false. I want to reset it so when it calculates the next row, I want it to get a fresh value. Currently it is accumulative. Thanks.
Hi wpf_ ,
Please follow my steps to have a try.
(Note: Please replace my [Total values] with you [count].)
Total values = SUM('Table'[Values])Count Blank values = CALCULATE ( COUNTROWS ( FILTER ( 'Table', [Total values] = 0 ) ), FILTER ( ALL ( 'Table' ), 'Table'[Date] <= MAX ( 'Table'[Date] ) ) )Running totals = VAR curr = [Count Blank values] RETURN CALCULATE ( 'Table'[Total values], FILTER ( ALL ( 'Table' ), 'Table'[Date] <= MAX ( 'Table'[Date] ) && [Count Blank values] = curr ) )
2 Replies
- v-xuding-msft
Community Support
Hi wpf_ ,
Please follow my steps to have a try.
(Note: Please replace my [Total values] with you [count].)
Total values = SUM('Table'[Values])Count Blank values = CALCULATE ( COUNTROWS ( FILTER ( 'Table', [Total values] = 0 ) ), FILTER ( ALL ( 'Table' ), 'Table'[Date] <= MAX ( 'Table'[Date] ) ) )Running totals = VAR curr = [Count Blank values] RETURN CALCULATE ( 'Table'[Total values], FILTER ( ALL ( 'Table' ), 'Table'[Date] <= MAX ( 'Table'[Date] ) && [Count Blank values] = curr ) )