Forum Discussion
Robert14358
Resolver III
3 years agoCALCULATETABLE with GROUPBY
Hello all.
im trying to use CALCULATETABLE with GROUPBY and im running into issues.
i need to use CALCULATETABLE because im using USERELATIONSHIP, but GROUPBY doesn't seems to accept CALCULTATETABLE as a proper source.
is there anyway to to use CALCULATETABLE with GROUPBY.
Thank you
Chat GPT was able to help, ๐
This was the syntax I needed:EXPORT =VAR VARTABLE =CALCULATETABLE(GROUPBY(),USERELATIONSHIP(),)RETURNVARTABLE
3 Replies
- Greg_Deckler
Community Champion
Robert14358 I don't see any issue using CALCULATETABLE with GROUPBY. For example, this works in my test scenario:
Table = GROUPBY( CALCULATETABLE( 'Product Inventory', 'Product Inventory'[ProductKey] = 167), [ProductKey], "Sum", SUMx( CURRENTGROUP(), [UnitCost] ) )- Robert14358
Resolver III
Chat GPT was able to help, ๐
This was the syntax I needed:EXPORT =VAR VARTABLE =CALCULATETABLE(GROUPBY(),USERELATIONSHIP(),)RETURNVARTABLE- Greg_Deckler
Community Champion
Robert14358 Sorry, had it reversed. Yes, CALCULATETABLE, should be able to take any table expression as a first parameter, including GROUPBY (which returns a table).