Forum Discussion
Calculating Month value based on Cumulative Weekly Data with 2 variables
- 5 years ago
UK06B1 , Based on what I got so far,
You can new column that give you weekly values
new column =
var _max = maxx(filter(Table, [Employee Name] = earlier([employee name]) && [Week ending] <earlier([Week ending])), [week ending])
return
[Number of hours] - maxx(filter(Table, [Employee Name] = earlier([employee name]) && [Week ending] =_max), [Number of hours])You can distribute this table with help date table if needed
new column =
var _max = maxx(filter(Table, [Employee Name] = earlier([employee name]) && [Week ending] <earlier([Week ending])), [week ending])
return
[Number of hours] - maxx(filter(Table, [Employee Name] = earlier([employee name]) && [Week ending] =_max), [Number of hours])How to divide/distribute values between start date or end date or count days across months/days: https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-or-end-date/ba-p/1503785
- 5 years ago
Hi UK06B1
Here is a method of calculated column.
Month Movement = VAR __lastWeekEnding = 'Table (2)'[Week Ending] - 7 RETURN 'Table (2)'[Number of Hours] - MAXX ( FILTER ( 'Table (2)', 'Table (2)'[Name] = EARLIER ( 'Table (2)'[Name] ) && 'Table (2)'[Time Type] = EARLIER ( 'Table (2)'[Time Type] ) && 'Table (2)'[Week Ending] = __lastWeekEnding ), 'Table (2)'[Number of Hours] )Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Hi UK06B1
Here is a method of calculated column.
Month Movement =
VAR __lastWeekEnding = 'Table (2)'[Week Ending] - 7
RETURN
'Table (2)'[Number of Hours]
- MAXX (
FILTER (
'Table (2)',
'Table (2)'[Name] = EARLIER ( 'Table (2)'[Name] )
&& 'Table (2)'[Time Type] = EARLIER ( 'Table (2)'[Time Type] )
&& 'Table (2)'[Week Ending] = __lastWeekEnding
),
'Table (2)'[Number of Hours]
)
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
- UK06B15 years agoHelper II
Brilliant thanks - and apologies for delay in accepting the solution.