Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
debiruman
Frequent Visitor

Can't update semantic model in Power BI Workspace - Expression.Error

Hello!

Can't update semantic model in Power BI Workspace.

The semantic model is not updated in the workspace when you click update.

Although there are no errors in Power Query and no issue when updating the same model with Power BI desktop.

 

Expression.Error: We cannot convert the value "[List]" to type List.. Microsoft.Data.Mashup.ErrorCode = 10277. . The exception was raised by the IDataReader interface. Please review the error message and provider documentation for further information and corrective action. Table: Promo Calendar. 

My suggestion -  something wrong with these steps:

Event_Name_Acceptable = Table.ExpandTableColumn(#"Объединенные запросы5", "Event_Name_Client_Acceptable", {"Event_Name_Contains"}, {"Event_Name_Contains"}),
CHECK_Event_Contains = Table.AddColumn(Event_Name_Acceptable, "Check_Event_Contains", each if[Event_Name_Contains]=null then "NOT_MATCH" else if List.AnyTrue(List.Transform([Event_Name_Contains],(substring) => Text.Contains([Копия EventName],substring)))=true then "MATCH_TRUE" else "MATCH_FALSE"),
#"Объединенные запросы8" = Table.NestedJoin(CHECK_Event_Contains, {"Client_Code", "Action type"}, Promo_Type_Client_Exclude, {"Client_Code", "Exclude_Promo_Types"}, "Promo_Type_Client_Exclude", JoinKind.LeftOuter),
Promo_Type_Exclude = Table.ExpandTableColumn(#"Объединенные запросы8", "Promo_Type_Client_Exclude", {"Exclude_Promo_Types"}, {"Exclude_Promo_Types"}),
#"Объединенные запросы12" = Table.NestedJoin(Promo_Type_Exclude, {"Client_Code", "Creation method"}, Creation_Method_Client_Exclude, {"Client_Code", "Creation_Method_Exclude"}, "Creation_Method_Client_Exclude", JoinKind.LeftOuter),
Creation_Method_Exclude = Table.ExpandTableColumn(#"Объединенные запросы12", "Creation_Method_Client_Exclude", {"Creation_Method_Exclude"}, {"Creation_Method_Exclude"}),
#"Объединенные запросы10" = Table.NestedJoin(Creation_Method_Exclude, {"Client_Code"}, Event_Name_Client_NOT_Acceptable, {"Client_Code"}, "Event_Name_Client_NOT_Acceptable", JoinKind.LeftOuter),
Event_Name_NOT_Acceptable = Table.ExpandTableColumn(#"Объединенные запросы10", "Event_Name_Client_NOT_Acceptable", {"Event_Name_NOT_Contains"}, {"Event_Name_NOT_Contains"}),
CHECK_Event_NOT_Contains = Table.AddColumn(Event_Name_NOT_Acceptable, "CHECK_Event_NOT_Contains", each if[Event_Name_NOT_Contains]=null then "NOT_MATCH" else if List.AnyTrue(List.Transform([Event_Name_NOT_Contains],(substring) => Text.Contains([Копия EventName],substring)))=true then "MATCH_TRUE" else "MATCH_FALSE"),
#"Event Type" = Table.AddColumn(CHECK_Event_NOT_Contains, "Event Type", each if ([Check_Event_Contains] = "MATCH_FALSE" or [CHECK_Event_NOT_Contains] = "MATCH_TRUE") then "Other Event" else if [Exclude_Promo_Types]<>null then "Other Event" else if [Creation_Method_Exclude]<>null then "Other Event" else "Calendar Event"),
#"Строки с примененным фильтром3" = Table.SelectRows(#"Event Type", each ([Event Type] = "Calendar Event")),

 

1 ACCEPTED SOLUTION
debiruman
Frequent Visitor

That modification helped:
CHECK_Event_NOT_Contains = Table.AddColumn(Event_Name_NOT_Acceptable, "CHECK_Event_NOT_Contains", each
if Value.Is([Event_Name_NOT_Contains], type list) = false then "NOT_MATCH"
else if List.IsEmpty([Event_Name_NOT_Contains]) then "NOT_MATCH"
else if List.AnyTrue(List.Transform([Event_Name_NOT_Contains], (substring) => Text.Contains([Копия EventName], substring))) then "MATCH_TRUE"
else "MATCH_FALSE"
),

View solution in original post

4 REPLIES 4
debiruman
Frequent Visitor

That modification helped:
CHECK_Event_NOT_Contains = Table.AddColumn(Event_Name_NOT_Acceptable, "CHECK_Event_NOT_Contains", each
if Value.Is([Event_Name_NOT_Contains], type list) = false then "NOT_MATCH"
else if List.IsEmpty([Event_Name_NOT_Contains]) then "NOT_MATCH"
else if List.AnyTrue(List.Transform([Event_Name_NOT_Contains], (substring) => Text.Contains([Копия EventName], substring))) then "MATCH_TRUE"
else "MATCH_FALSE"
),

v-junyant-msft
Community Support
Community Support

Hi @debiruman ,

Can you try this code to check whether it will work:

Event_Name_Acceptable = Table.ExpandTableColumn(#"Объединенные запросы5", "Event_Name_Client_Acceptable", {"Event_Name_Contains"}, {"Event_Name_Contains"}),
CHECK_Event_Contains = Table.AddColumn(Event_Name_Acceptable, "Check_Event_Contains", each 
    if [Event_Name_Contains] = null then "NOT_MATCH" 
    else if List.IsEmpty([Event_Name_Contains]) then "NOT_MATCH" 
    else if List.AnyTrue(List.Transform([Event_Name_Contains], (substring) => Text.Contains([Копия EventName], substring))) then "MATCH_TRUE" 
    else "MATCH_FALSE"
),
#"Объединенные запросы8" = Table.NestedJoin(CHECK_Event_Contains, {"Client_Code", "Action type"}, Promo_Type_Client_Exclude, {"Client_Code", "Exclude_Promo_Types"}, "Promo_Type_Client_Exclude", JoinKind.LeftOuter),
Promo_Type_Exclude = Table.ExpandTableColumn(#"Объединенные запросы8", "Promo_Type_Client_Exclude", {"Exclude_Promo_Types"}, {"Exclude_Promo_Types"}),
#"Объединенные запросы12" = Table.NestedJoin(Promo_Type_Exclude, {"Client_Code", "Creation method"}, Creation_Method_Client_Exclude, {"Client_Code", "Creation_Method_Exclude"}, "Creation_Method_Client_Exclude", JoinKind.LeftOuter),
Creation_Method_Exclude = Table.ExpandTableColumn(#"Объединенные запросы12", "Creation_Method_Client_Exclude", {"Creation_Method_Exclude"}, {"Creation_Method_Exclude"}),
#"Объединенные запросы10" = Table.NestedJoin(Creation_Method_Exclude, {"Client_Code"}, Event_Name_Client_NOT_Acceptable, {"Client_Code"}, "Event_Name_Client_NOT_Acceptable", JoinKind.LeftOuter),
Event_Name_NOT_Acceptable = Table.ExpandTableColumn(#"Объединенные запросы10", "Event_Name_Client_NOT_Acceptable", {"Event_Name_NOT_Contains"}, {"Event_Name_NOT_Contains"}),
CHECK_Event_NOT_Contains = Table.AddColumn(Event_Name_NOT_Acceptable, "CHECK_Event_NOT_Contains", each 
    if [Event_Name_NOT_Contains] = null then "NOT_MATCH" 
    else if List.IsEmpty([Event_Name_NOT_Contains]) then "NOT_MATCH" 
    else if List.AnyTrue(List.Transform([Event_Name_NOT_Contains], (substring) => Text.Contains([Копия EventName], substring))) then "MATCH_TRUE" 
    else "MATCH_FALSE"
),
#"Event Type" = Table.AddColumn(CHECK_Event_NOT_Contains, "Event Type", each 
    if ([Check_Event_Contains] = "MATCH_FALSE" or [CHECK_Event_NOT_Contains] = "MATCH_TRUE") then "Other Event" 
    else if [Exclude_Promo_Types] <> null then "Other Event" 
    else if [Creation_Method_Exclude] <> null then "Other Event" 
    else "Calendar Event"
),
#"Строки с примененным фильтром3" = Table.SelectRows(#"Event Type", each [Event Type] = "Calendar Event")

The code you provided is not complete. I am not sure whether it can solve your problem. If it cannot be solved, you'd better provide the complete M code. Thank you!

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi

v-junyant-msft.
Unfortunately the same error after your code:
Expression.Error: We cannot convert the value "[List]" to type List.. Microsoft.Data.Mashup.ErrorCode = 10277. . The exception was raised by the IDataReader interface. Please review the error message and provider documentation for further information and corrective action. Table: Promo Calendar.
Below is full code:

let

Источник = Source_CSV,
#"Переименованные столбцы" = Table.RenameColumns(Источник,{{"Forecast_Units_weight", "Forecast_Units_weight_TMP"}, {"Forecast_Units", "Forecast_Units_TMP"}, {"Action_Cost", "Action_Cost_TMP"} , {"Action_Cost_Weight", "Action_Cost_Weight_TMP"},{"Action_Cost_V2", "Action_Cost_V2_TMP"},{"Action_Cost_V2_Weight", "Action_Cost_V2_Weight_TMP"}, {"Forecast_Val", "Forecast_Val_TMP"},{"Forecast_Val_Weight", "Forecast_Val_Weight_TMP"},{"Format", "Format_TMP"}}),
#"Текст в верхнем регистре" = Table.TransformColumns(#"Переименованные столбцы",{{"Format_TMP", Text.Upper, type text}}),
#"Добавлен пользовательский объект7" = Table.AddColumn(#"Текст в верхнем регистре", "Year", each Date.Year([Year_Month_SO])),
#"Измененный тип1" = Table.TransformColumnTypes(#"Добавлен пользовательский объект7",{{"Year", type text}}),
#"Объединенные запросы4" = Table.NestedJoin(#"Измененный тип1", {"Format_TMP"}, Tander_Split, {"FORMAT"}, "Tander_Split", JoinKind.LeftOuter),
#"Развернутый элемент Tander_Split" = Table.ExpandTableColumn(#"Объединенные запросы4", "Tander_Split", {"SPLIT"}, {"SPLIT"}),
#"Добавлен пользовательский объект9" = Table.AddColumn(#"Развернутый элемент Tander_Split", "Format", each if [SPLIT]<>null then [SPLIT] else [Format_TMP]),
#"Добавлен пользовательский объект10" = Table.AddColumn(#"Добавлен пользовательский объект9", "Forecast_Units", each if [SPLIT]<>null then [Forecast_Units_TMP]/3 else [Forecast_Units_TMP]),
#"Добавлен пользовательский объект11" = Table.AddColumn(#"Добавлен пользовательский объект10", "Forecast_Units_weight", each if [SPLIT]<> null then [Forecast_Units_weight_TMP]/3 else [Forecast_Units_weight_TMP]),
#"Добавлен пользовательский объект12" = Table.AddColumn(#"Добавлен пользовательский объект11", "Action_Cost", each if [SPLIT]<> null then [Action_Cost_TMP]/3 else [Action_Cost_TMP]),
#"Добавлен пользовательский объект13" = Table.AddColumn(#"Добавлен пользовательский объект12", "Action_Cost_Weight", each if [SPLIT]<> null then [Action_Cost_Weight_TMP]/3 else [Action_Cost_Weight_TMP]),
#"Добавлен пользовательский объект114" = Table.AddColumn(#"Добавлен пользовательский объект13", "Action_Cost_V2", each if [SPLIT]<> null then [Action_Cost_V2_TMP]/3 else [Action_Cost_V2_TMP]),
#"Добавлен пользовательский объект115" = Table.AddColumn(#"Добавлен пользовательский объект114", "Action_Cost_V2_Weight", each if [SPLIT]<> null then [Action_Cost_V2_Weight_TMP]/3 else [Action_Cost_V2_Weight_TMP]),
#"Добавлен пользовательский объект116" = Table.AddColumn(#"Добавлен пользовательский объект115", "Forecast_Val", each if [SPLIT]<> null then [Forecast_Val_TMP]/3 else [Forecast_Val_TMP]),
#"Добавлен пользовательский объект117" = Table.AddColumn(#"Добавлен пользовательский объект116", "Forecast_Val_Weight", each if [SPLIT]<> null then [Forecast_Val_Weight_TMP]/3 else [Forecast_Val_Weight_TMP]),

#"Измененный тип" = Table.TransformColumnTypes(#"Добавлен пользовательский объект117",{{"Year_Month_SO", type date}, {"Sell-Out period From", type date}, {"Sell-Out period To", type date}, {"ActionID", type text}, {"Forecast_Units_weight", type number}, {"Forecast_Units", type number}, {"Action_Cost", type number}, {"Action_Cost_Weight", type number}, {"Action_Cost_V2", type number}, {"Action_Cost_V2_Weight", type number}, {"Forecast_Val", type number}, {"Forecast_Val_Weight", type number}}),
#"Объединенные запросы" = Table.NestedJoin(#"Измененный тип", {"Client_Code"}, #"mdm_0100_CLIENT_TAB", {"Code"}, "mdm_0100_CLIENT_TAB", JoinKind.LeftOuter),
#"Развернутый элемент mdm_0100_CLIENT_TAB" = Table.ExpandTableColumn(#"Объединенные запросы", "mdm_0100_CLIENT_TAB", {"Channel_Name", "Subchannel_Code", "Subchannel_Name"}, {"Channel_Name_Basic", "Subchannel_Code_Basic", "Subchannel_Name_Basic"}),
#"Строки с примененным фильтром" = Table.SelectRows(#"Развернутый элемент mdm_0100_CLIENT_TAB", each ([Subchannel_Name_Basic] <> null and [Subchannel_Name_Basic] <> "Distributor")),
#"Объединенные запросы2" = Table.NestedJoin(#"Строки с примененным фильтром", {"Format"}, mdm_0100_Store_Subchannel_TAB, {"Code"}, "mdm_0100_Store_Subchannel_TAB", JoinKind.LeftOuter),
#"Развернутый элемент mdm_0100_Store_Subchannel_TAB" = Table.ExpandTableColumn(#"Объединенные запросы2", "mdm_0100_Store_Subchannel_TAB", {"Name", "Channel_Name"}, {"Subchannel_Name_Format", "Channel_Name_Format"}),
#"Добавлен пользовательский объект2" = Table.AddColumn(#"Развернутый элемент mdm_0100_Store_Subchannel_TAB", "Subchannel_Code", each if [Format]=null then [Subchannel_Code_Basic] else [Format]),
#"Добавлен пользовательский объект4" = Table.AddColumn(#"Добавлен пользовательский объект2", "Subchannel_Name", each if[Format]=null then [Subchannel_Name_Basic] else [Subchannel_Name_Format]),
#"Добавлен пользовательский объект5" = Table.AddColumn(#"Добавлен пользовательский объект4", "Channel_Name", each if [Format]=null then [Channel_Name_Basic] else [Channel_Name_Format]),
#"Объединенные запросы1" = Table.NestedJoin(#"Добавлен пользовательский объект5", {"SAPCode"}, Prod_Mapping, {"SAPCode"}, "Prod_Mapping", JoinKind.LeftOuter),
#"Развернутый элемент Prod_Mapping" = Table.ExpandTableColumn(#"Объединенные запросы1", "Prod_Mapping", {"Segment", "Franchise", "ALT_Franchise", "ALT_Franchise_2", "Exclude_SKU"}, {"Segment_TMP", "Franchise_TMP", "ALT_Franchise", "ALT_Franchise_2", "Exclude_SKU"}),
#"Добавлен пользовательский объект3" = Table.AddColumn(#"Развернутый элемент Prod_Mapping", "Mapping_Status", each if [Need_mapping_Status]="not_need_mapping" then [Need_mapping_Status]
else if[Segment_TMP]<>null and [Need_mapping_Status]="need_mapping" and [Exclude_SKU]<> null then "wrong_mapping"
else if[Segment_TMP]=null and [Need_mapping_Status]="need_mapping" and [Exclude_SKU]= null then "not_mapped" else "mapped"),
#"Добавлен пользовательский объект" = Table.AddColumn(#"Добавлен пользовательский объект3", "Segment", each if [Segment_TMP]=null and [Mapping_Status]="not_need_mapping" then [Prod_Line] else if [Segment_TMP]=null and [Mapping_Status]="not_mapped" then [Mapping_Status] else [Segment_TMP]),
#"Добавлен пользовательский объект1" = Table.AddColumn(#"Добавлен пользовательский объект", "Franchise", each if [Franchise_TMP]=null and [Mapping_Status]="not_need_mapping" then [Mat_Group] else if [Franchise_TMP]=null and [Mapping_Status]="not_mapped" then [Mapping_Status] else [Franchise_TMP]),
#"Action Franchise Change" = Table.NestedJoin(#"Добавлен пользовательский объект1", {"ActionID", "Franchise"}, Action_Franchise_Change, {"ACTION_ID", "Franchise_NEW"}, "Action_Franchise_Change", JoinKind.LeftOuter),
#"Развернутый элемент Action_Franchise_Change" = Table.ExpandTableColumn(#"Action Franchise Change", "Action_Franchise_Change", {"Franchise_NEW"}, {"Franchise_NEW"}),
#"Action_Franchise_Change_Distinct Action ID" = Table.NestedJoin(#"Развернутый элемент Action_Franchise_Change", {"ActionID"}, Table.Distinct(Action_Franchise_Change, {"ACTION_ID"}), {"ACTION_ID"}, "Action_Franchise_Change", JoinKind.LeftOuter),
#"Развернутый элемент Action_Franchise_Change_Distinct Action ID" = Table.ExpandTableColumn(#"Action_Franchise_Change_Distinct Action ID", "Action_Franchise_Change", {"ACTION_ID"}, {"ACTION_ID"}),
#"Exclude extra Franchise" = Table.SelectRows(#"Развернутый элемент Action_Franchise_Change_Distinct Action ID", each (([Franchise_NEW] <> null) and [ACTION_ID] <> null) or [ACTION_ID] = null),
#"Строки с примененным фильтром1" = Table.SelectRows(#"Exclude extra Franchise", each ([Mapping_Status] <> "not_mapped")),
#"Дублированный столбец" = Table.DuplicateColumn(#"Строки с примененным фильтром1", "EventName", "Копия EventName"),
#"Текст в нижнем регистре" = Table.TransformColumns(#"Дублированный столбец",{{"Копия EventName", Text.Lower, type text}}),
#"Объединенные запросы5" = Table.NestedJoin(#"Текст в нижнем регистре", {"Client_Code"}, Event_Name_Client_Acceptable, {"Client_Code"}, "Event_Name_Client_Acceptable", JoinKind.LeftOuter),
Event_Name_Acceptable = Table.ExpandTableColumn(#"Объединенные запросы5", "Event_Name_Client_Acceptable", {"Event_Name_Contains"}, {"Event_Name_Contains"}),
CHECK_Event_Contains = Table.AddColumn(Event_Name_Acceptable, "Check_Event_Contains", each
if [Event_Name_Contains] = null then "NOT_MATCH"
else if List.IsEmpty([Event_Name_Contains]) then "NOT_MATCH"
else if List.AnyTrue(List.Transform([Event_Name_Contains], (substring) => Text.Contains([Копия EventName], substring))) then "MATCH_TRUE"
else "MATCH_FALSE"
),
#"Объединенные запросы8" = Table.NestedJoin(CHECK_Event_Contains, {"Client_Code", "Action type"}, Promo_Type_Client_Exclude, {"Client_Code", "Exclude_Promo_Types"}, "Promo_Type_Client_Exclude", JoinKind.LeftOuter),
Promo_Type_Exclude = Table.ExpandTableColumn(#"Объединенные запросы8", "Promo_Type_Client_Exclude", {"Exclude_Promo_Types"}, {"Exclude_Promo_Types"}),
#"Объединенные запросы12" = Table.NestedJoin(Promo_Type_Exclude, {"Client_Code", "Creation method"}, Creation_Method_Client_Exclude, {"Client_Code", "Creation_Method_Exclude"}, "Creation_Method_Client_Exclude", JoinKind.LeftOuter),
Creation_Method_Exclude = Table.ExpandTableColumn(#"Объединенные запросы12", "Creation_Method_Client_Exclude", {"Creation_Method_Exclude"}, {"Creation_Method_Exclude"}),
#"Объединенные запросы10" = Table.NestedJoin(Creation_Method_Exclude, {"Client_Code"}, Event_Name_Client_NOT_Acceptable, {"Client_Code"}, "Event_Name_Client_NOT_Acceptable", JoinKind.LeftOuter),
Event_Name_NOT_Acceptable = Table.ExpandTableColumn(#"Объединенные запросы10", "Event_Name_Client_NOT_Acceptable", {"Event_Name_NOT_Contains"}, {"Event_Name_NOT_Contains"}),
CHECK_Event_NOT_Contains = Table.AddColumn(Event_Name_NOT_Acceptable, "CHECK_Event_NOT_Contains", each
if [Event_Name_NOT_Contains] = null then "NOT_MATCH"
else if List.IsEmpty([Event_Name_NOT_Contains]) then "NOT_MATCH"
else if List.AnyTrue(List.Transform([Event_Name_NOT_Contains], (substring) => Text.Contains([Копия EventName], substring))) then "MATCH_TRUE"
else "MATCH_FALSE"
),
#"Event Type" = Table.AddColumn(CHECK_Event_NOT_Contains, "Event Type", each
if ([Check_Event_Contains] = "MATCH_FALSE" or [CHECK_Event_NOT_Contains] = "MATCH_TRUE") then "Other Event"
else if [Exclude_Promo_Types] <> null then "Other Event"
else if [Creation_Method_Exclude] <> null then "Other Event"
else "Calendar Event"
),
#"Строки с примененным фильтром3" = Table.SelectRows(#"Event Type", each [Event Type] = "Calendar Event"),

 
 
Preview
 
 
 

#"Объединенные запросы3" = Table.NestedJoin(#"Строки с примененным фильтром3", {"Client_Code", "Subchannel_Code"}, TM_Chains_List, {"Client_Code", "Format"}, "TM_Chains_List", JoinKind.LeftOuter),
#"Развернутый элемент TM_Chains_List" = Table.ExpandTableColumn(#"Объединенные запросы3", "TM_Chains_List", {"TM_Chains_List", "Chain_Code", "RGM Chain name", "Chains_With_Dupl_Actions"}, {"TM_Chains_List", "Chain_Code", "RGM Chain name", "Chains_With_Dupl_Actions"}),
#"Добавлен пользовательский объект14" = Table.AddColumn(#"Развернутый элемент TM_Chains_List", "Data Type", each "SFM"),
#"Добавлен пользовательский объект18" = Table.AddColumn(#"Добавлен пользовательский объект14", "Check_Dupl_Actions", each if [Check_Dupl_Action] <> null and [Chains_With_Dupl_Actions] <> null then "Exclude_dupl" else null),
#"Объединенные запросы13" = Table.NestedJoin(#"Добавлен пользовательский объект18", {"ActionID"}, #"Action Exclude", {"ACTION_EXCLUDE"}, "Action Exclude", JoinKind.LeftOuter),
#"Объединенный Exclude Action" = Table.ExpandTableColumn(#"Объединенные запросы13", "Action Exclude", {"ACTION_EXCLUDE"}, {"Action Exclude.ACTION_EXCLUDE"}),
Action_Exclude = Table.SelectRows(#"Объединенный Exclude Action", each [Action Exclude.ACTION_EXCLUDE] = null),
#"Другие удаленные столбцы1" = Table.SelectColumns(Action_Exclude,{"Year_Month_SO", "Client_Code", "Client_Name", "Action type", "Action type name", "Detailed promo type", "ActionID", "EventName", "Sell-Out period From", "Sell-Out period To", "Discount", "RegularShelfPrice", "DiscountOnShelf", "PromoPrice", "Mark", "Prod_Line", "Mat_Group", "SAPCode", "SKU_Name", "Creation method", "Action_Status", "Category", "Need_mapping_Status", "Year", "Format", "Forecast_Units_weight", "Action_Cost_Weight", "Forecast_Val_Weight", "Subchannel_Code", "Subchannel_Name", "Channel_Name", "ALT_Franchise", "Mapping_Status", "Segment", "Franchise", "Event Type", "TM_Chains_List", "Chain_Code", "RGM Chain name", "Data Type"}),
#"Добавленный запрос" = Table.Combine({#"Другие удаленные столбцы1", #"Promo ADD",#"Make ADD"}),
#"Добавлен пользовательский объект15" = Table.AddColumn(#"Добавленный запрос", "Version", each "Actual"),
#"Добавлен пользовательский объект19" = Table.AddColumn(#"Добавлен пользовательский объект15", "Period_M_From", each if

Date.Month([#"Sell-Out period From"]) = Date.Month([Year_Month_SO]) then
[#"Sell-Out period From"]

else Date.StartOfMonth([Year_Month_SO])),
TAB1 = Table.AddColumn(#"Добавлен пользовательский объект19", "Period_M_To", each if Date.Month([#"Sell-Out period To"]) = Date.Month([Year_Month_SO]) then [#"Sell-Out period To"]

else Date.EndOfMonth([Year_Month_SO])),
#"Измененный тип3" = Table.TransformColumnTypes(TAB1,{{"Period_M_From", Int64.Type}, {"Period_M_To", Int64.Type}}),
#"Добавлен пользовательский объект21" = Table.AddColumn(#"Измененный тип3", "Days_List", each {[Period_M_From]..[Period_M_To]}),
#"Развернутый элемент Days_List" = Table.ExpandListColumn(#"Добавлен пользовательский объект21", "Days_List"),
#"Добавленный запрос1" = Table.Combine({#"Развернутый элемент Days_List", Versions}),
#"Объединенные запросы11" = Table.NestedJoin(#"Добавленный запрос1", {"Client_Code", "Subchannel_Code", "Franchise", "Year_Month_SO"}, Chain_Franchise_Exclude, {"Client_Code", "Format", "Franchise_Exclude", "Month"}, "Chain_Franchise_Exclude", JoinKind.LeftOuter),
#"Развернутый элемент Chain_Franchise_Exclude" = Table.ExpandTableColumn(#"Объединенные запросы11", "Chain_Franchise_Exclude", {"Franchise_Exclude"}, {"Chain_Franchise_Exclude.Franchise_Exclude"}),
#"Franchise Exclude" = Table.SelectRows(#"Развернутый элемент Chain_Franchise_Exclude", each [Chain_Franchise_Exclude.Franchise_Exclude] = null),
#"Объединенные запросы6" = Table.NestedJoin(#"Franchise Exclude", {"Subchannel_Code", "Franchise", "Client_Code"}, Weight_RGM, {"Subchannel_Code", "Franchise", "Client_Code"}, "Weight_RGM", JoinKind.LeftOuter),
#"Развернутый элемент Weight_RGM" = Table.ExpandTableColumn(#"Объединенные запросы6", "Weight_RGM", {"Weight RGM"}, {"Weight RGM"}),
#"Объединенные запросы9" = Table.NestedJoin(#"Развернутый элемент Weight_RGM", {"Client_Code", "Subchannel_Code", "Franchise"}, Weight_TM, {"TPS_SKU_FACTS[Partner Code]", "Format", "Franchise"}, "Weight_TM", JoinKind.LeftOuter),
#"Развернутый элемент Weight_TM" = Table.ExpandTableColumn(#"Объединенные запросы9", "Weight_TM", {"WEIGHT","Weight_Cat","Weight_Fr_In Client"}, {"WEIGHT","Weight_Cat","Weight_Fr_In Client"}),
#"Объединенные запросы15" = Table.NestedJoin(#"Развернутый элемент Weight_TM", {"Franchise"}, #"RECO RGM Discount", {"Franchise Mapping"}, "RECO RGM Discount", JoinKind.LeftOuter),
#"Переименованные столбцы2" = Table.RenameColumns(#"Объединенные запросы15",{{"deep coeff", "deep coeff_TMP1"}}),
#"Развернутый элемент RECO RGM Discount" = Table.ExpandTableColumn(#"Переименованные столбцы2", "RECO RGM Discount", {"Discount Std", "deep", "deep coeff"}, {"Discount Std", "deep", "deep coeff_TMP2"}),
#"Добавлен пользовательский объект20" = Table.AddColumn(#"Развернутый элемент RECO RGM Discount", "deep coeff", each if[deep coeff_TMP1]=null then [deep coeff_TMP2] else [deep coeff_TMP1]),
#"Другие удаленные столбцы" = Table.SelectColumns(#"Добавлен пользовательский объект20",{"Year_Month_SO", "Client_Code", "Client_Name", "Action type", "Action type name", "Detailed promo type", "ActionID", "EventName", "Sell-Out period From", "Sell-Out period To", "Discount", "RegularShelfPrice", "DiscountOnShelf", "PromoPrice", "Mark", "Prod_Line", "Mat_Group", "SAPCode", "SKU_Name", "Creation method", "Action_Status", "Category", "Need_mapping_Status", "Year", "Format", "Forecast_Units_weight", "Action_Cost_Weight", "Forecast_Val_Weight", "Subchannel_Code", "Subchannel_Name", "Channel_Name", "ALT_Franchise", "Mapping_Status", "Segment", "Franchise", "Event Type", "TM_Chains_List", "Chain_Code", "RGM Chain name", "Data Type", "number _of_SKU", "Forecast_Units", "month_type", "Chain", "Version", "Period_M_From", "Period_M_To", "Days_List", "Weight RGM", "WEIGHT", "Weight_Cat", "Weight_Fr_In Client", "Discount Std", "deep", "deep coeff"}),
#"Объединенные запросы RECO DAYS" = Table.NestedJoin(#"Другие удаленные столбцы", {"Client_Code", "Subchannel_Code", "Franchise", "Year"}, #"RECO RGM Days", {"Client_Code", "Format", "Franchise", "Year"}, "RECO Days", JoinKind.LeftOuter),
#"Развернутый элемент RECO DAYS" = Table.ExpandTableColumn(#"Объединенные запросы RECO DAYS", "RECO Days", { "Ttl Promo weeks"}, {"Ttl Promo weeks"}),
#"Строки с примененным фильтром2" = Table.SelectRows(#"Развернутый элемент RECO DAYS", each true),
#"Добавлен пользовательский объект6" = Table.AddColumn(#"Строки с примененным фильтром2", "CLient_With_Format", each [Client_Name]&"_<"&[Subchannel_Code]&">"),
#"Добавлен пользовательский объект8" = Table.AddColumn(#"Добавлен пользовательский объект6", "Quarter", each "Q" & Number.ToText(Date.QuarterOfYear([Year_Month_SO]))),
#"Добавлен пользовательский объект17" = Table.AddColumn(#"Добавлен пользовательский объект8", "Wave_Type", each if ([deep]=null or [Discount]<[deep]*100 or [Data Type] = "Excel" or [Data Type] = "Correction_Form") and [deep coeff]=null then "Normal Wave" else "Deep Wave"),
#"Измененный тип2" = Table.TransformColumnTypes(#"Добавлен пользовательский объект17",{{"Ttl Promo weeks", type number}, {"Discount Std", type number}, {"deep coeff", type number}, {"deep", type number}, {"Period_M_From", type date}, {"Period_M_To", type date}, {"Days_List", type date}}),


#"Объединенные запросы14" = Table.NestedJoin(#"Измененный тип2" , {"Segment", "Franchise"}, Show_Franchise, {"Segment", "Franchise"}, "Show_Franchise", JoinKind.LeftOuter),
#"Развернутый элемент Show_Franchise" = Table.ExpandTableColumn(#"Объединенные запросы14", "Show_Franchise", {"Show_Franchise"}, {"Show_Franchise"})
in
#"Развернутый элемент Show_Franchise"

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.