Forum Discussion
powerbienthuzi
4 years agoFrequent Visitor
Simple GroupBy Question
Hello - I am trying to group people with the same period to show the summed value of compensation. So for instance, this employee example should show 14505 in period one. My current approach use...
- 4 years ago
powerbienthuzi looks like you need a derivedTbl, Can you try this
derivedTbl= groupby(PnL_Data, PnL_Data[deID], PnL_Data[pstartdate], PnL_Data[pperiod],"sum", SUMX(CURRENTGROUP(),PnL_Data[AccruedCompensation]))SUMAMRIZE has more layers than it looks
https://www.sqlbi.com/articles/all-the-secrets-of-summarize/
smpa01
4 years agoCommunity Champion
powerbienthuzi looks like you need a derivedTbl, Can you try this
derivedTbl=
groupby(PnL_Data,
PnL_Data[deID],
PnL_Data[pstartdate],
PnL_Data[pperiod],"sum", SUMX(CURRENTGROUP(),PnL_Data[AccruedCompensation]))
SUMAMRIZE has more layers than it looks
https://www.sqlbi.com/articles/all-the-secrets-of-summarize/
powerbienthuzi
4 years agoFrequent Visitor
That worked. Thank you!