Forum Discussion
OlegV
2 years agoHelper III
cannot create a calculated column with groupby, summarize, summarizecolumns
Hello, I am stuck with the code, please help me. I am createing a calculated table using variables. At a certain step, I need to group leftjoined tables and create a calculated column "ActualDel...
- 2 years ago
Here is a working solution:
var group_tab = ADDCOLUMNS( SUMMARIZE( join_tab, [SalesOrder], [OrderDate]), "TotalQty", SUMX(FILTER(join_tab,[SalesOrder] = EARLIER([SalesOrder])),[Quantity]), "ActuralDeliveryDate",if(COUNTROWS(FILTER(join_tab,[SalesOrder] = EARLIER([SalesOrder]) && ISBLANK([ActualDeliveryDate]))) > 0, BLANK(),MAXX(FILTER(join_tab,[SalesOrder] = EARLIER([SalesOrder]),[ActualDeliveryDate]) ) )
OlegV
2 years agoHelper III
Here is a working solution:
var group_tab =
ADDCOLUMNS(
SUMMARIZE(
join_tab,
[SalesOrder],
[OrderDate]),
"TotalQty", SUMX(FILTER(join_tab,[SalesOrder] = EARLIER([SalesOrder])),[Quantity]),
"ActuralDeliveryDate",if(COUNTROWS(FILTER(join_tab,[SalesOrder] = EARLIER([SalesOrder]) && ISBLANK([ActualDeliveryDate]))) > 0, BLANK(),MAXX(FILTER(join_tab,[SalesOrder] = EARLIER([SalesOrder]),[ActualDeliveryDate])
)
)