CustomerSKUDate = GENERATE( SUMMARIZE(CustomerSKUShareMonth,…
- User
Customer_SKU_Date = GENERATE( SUMMARIZE(Customer_SKU_Share_Month, Customer_SKU_Share_Month[Customer Code], Customer_SKU_Share_Month[SCU Code], Customer_SKU_Share_Month[StartDate], Customer_SKU_Share_Month[EndDate]), VAR StartDate = Customer_SKU_Share_Month[StartDate] VAR EndDate = Customer_SKU_Share_Month[EndDate] RETURN ADDCOLUMNS( CALENDAR(StartDate, EndDate), "Customer", Customer_SKU_Share_Month[Customer Code], "SKU", Customer_SKU_Share_Month[SCU Code] ) )
Modify the function in order to get unique calendat column for each combination of Customer Code and SCU Code
- Assistant
To get a unique calendar column for each combination of Customer Code and SCU Code, you can modify the function as follows:
Customer_SKU_Date = GENERATE( SUMMARIZE( Customer_SKU_Share_Month, Customer_SKU_Share_Month[Customer Code], Customer_SKU_Share_Month[SCU Code], Customer_SKU_Share_Month[StartDate], Customer_SKU_Share_Month[EndDate] ), VAR StartDate = Customer_SKU_Share_Month[StartDate] VAR EndDate = Customer_SKU_Share_Month[EndDate] VAR CustomerCode = Customer_SKU_Share_Month[Customer Code] VAR SCUCode = Customer_SKU_Share_Month[SCU Code] RETURN ADDCOLUMNS( FILTER( CALENDAR(StartDate, EndDate), Customer_SKU_Share_Month[Customer Code] = CustomerCode && Customer_SKU_Share_Month[SCU Code] = SCUCode ), "Customer", CustomerCode, "SKU", SCUCode ) )This modification introduces new variables,
CustomerCodeand , which store the values of Customer Code and SCU Code for each iteration of the function. Then, within the function, the calendar is filtered based on these variables to only include rows where the Customer Code and SCU Code match. This ensures that each combination of Customer Code and SCU Code will have its own unique calendar column.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.