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/
AlexisOlson
4 years agoSuper User
Does your PnL table have any filters you want that didn't get included when you summarized it?
powerbienthuzi
4 years agoFrequent Visitor
Hi Alexis - It has no filters that I needed.
- smpa014 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/
- powerbienthuzi4 years agoFrequent Visitor
That worked. Thank you!