Forum Discussion
2nd Calculated Column Formula
- Anonymous7 years ago
HiAnonymous ,
Try the following replace Table with your tablename
Percents = VAR _total80 = CALCULATE ( SUM ( 'Table'[80] ), FILTER ( 'Table', [Date] = EARLIER ( 'Table'[Date] ) ) ) RETURN DIVIDE ( [80], _total80 )Cheers
CheenuSing
- Anonymous7 years ago
Hi Anonymous
_total80 is a temproary variable created to compute the totals of column named 80 in your dataset, for each date.
FILTER ( 'Table', [Date] = EARLIER ( 'Table'[Date] ) ) checks if the current date is same as earlier row date and groups them together.
Cheers
CheenuSing
HiAnonymous ,
Try the following replace Table with your tablename
Percents =
VAR _total80 =
CALCULATE (
SUM ( 'Table'[80] ),
FILTER ( 'Table', [Date] = EARLIER ( 'Table'[Date] ) )
)
RETURN
DIVIDE ( [80], _total80 )
Cheers
CheenuSing
- Anonymous7 years agoNot applicable
Hello,
Can you break down what this is doing?
It works for the test data I posted, but not for my real/master file.
VAR _total80 =
CALCULATE (
SUM ( 'Table'[80] ),
FILTER ( 'Table', [Date] = EARLIER ( 'Table'[Date] ) )
)
RETURN
DIVIDE ( [80], _total80 )What is _total80?
If I filter by [Date] = EARLIER ('Table'[Date]) what is that doing?
TYIA
- Anonymous7 years agoNot applicable
Hi Anonymous
_total80 is a temproary variable created to compute the totals of column named 80 in your dataset, for each date.
FILTER ( 'Table', [Date] = EARLIER ( 'Table'[Date] ) ) checks if the current date is same as earlier row date and groups them together.
Cheers
CheenuSing
- Anonymous7 years agoNot applicable
Thank you! very much appreciate the additional explanation.