Forum Discussion
SUM and MAX
- 6 years ago
Hi Anonymous
you can create a calculated table like
Table 2 = ADDCOLUMNS( DISTINCT('Table'[ID]); "Hours Behind";CALCULATE(SUM('Table'[Hours completed each week]);ALLEXCEPT('Table';'Table'[ID]))-CALCULATE(MAX('Table'[Weeks since placement]);ALLEXCEPT('Table';'Table'[ID]))*CALCULATE(MAX('Table'[Target hours to be completed each week]);ALLEXCEPT('Table';'Table'[ID])) )do not hesitate to give a kudo to useful posts and mark solutions as solution
- 6 years ago
Untill you can write that yourself - I would ALWAYS reccomend having that in 3 or 4 sepperate
rowsCollumns, unless your data set already has more than Many rows and millions of lines. -Also I would do a behind pr week collumn - since this is also a good way to see a development if you plot it.
Also Since you have a Target pr week in each line - why not use that --- so if you ever encounter that it can warry over a project periond your calculations is still correct
Insert a new collumn with this formular if you just want the result:
Behind total = CALCULATE(SUM('Table'[Target hours to be completed each week]); FILTER('Table';'Table'[ID]=EARLIER('Table'[ID]))) -CALCULATE(SUM('Table'[Hours completed each week]); FILTER('Table';'Table'[ID]=EARLIER('Table'[ID]))) New collumn Behind pr. week:
New collumn Behind pr. week:Behind this week = 'Table'[Target hours to be completed each week]-'Table'[Hours completed each week]Hope this help... but also hope you add more columns to better understand the formulars and calculatitions, this has helped me alot of times.
Untill you can write that yourself - I would ALWAYS reccomend having that in 3 or 4 sepperate rows Collumns, unless your data set already has more than Many rows and millions of lines. -
Also I would do a behind pr week collumn - since this is also a good way to see a development if you plot it.
Also Since you have a Target pr week in each line - why not use that --- so if you ever encounter that it can warry over a project periond your calculations is still correct
Insert a new collumn with this formular if you just want the result:
Behind total = CALCULATE(SUM('Table'[Target hours to be completed each week]); FILTER('Table';'Table'[ID]=EARLIER('Table'[ID]))) -CALCULATE(SUM('Table'[Hours completed each week]); FILTER('Table';'Table'[ID]=EARLIER('Table'[ID])))
New collumn Behind pr. week:
New collumn Behind pr. week:
Behind this week = 'Table'[Target hours to be completed each week]-'Table'[Hours completed each week]
Hope this help... but also hope you add more columns to better understand the formulars and calculatitions, this has helped me alot of times.
- Anonymous6 years agoNot applicableThanks Rygaard. That's a good advice thank you for that. Having 3 or 4 columns would be easier to work with. I'll try to use the formula you provided. Cheers for that. Will let you know if it works.