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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Power BI - Losing Object Attributes when New Ones are Added with SAP BW 2.0 Connector

In a PBI query, I've selected a number of objects, attributes and measures through a SAP BW query using the 2.0 connector.  When I edit the previously save query and report and then add another object attribute and save the changes, the originaly selected object attributes are lost.  This is a bug that will need to be fixed.

Status: New
Comments
v-yuezhe-msft
Employee

@Anonymous ,

What is the Power BI Desktop version do you use? Could you please post M code in Power BI Desktop before & after you add the  object attribute ?

Regards,
Lydia

Anonymous
Not applicable

 

 

@v-yuezhe-msft 

Here is the code.  Thanks

 

Before

 

let

    Source = SapBusinessWarehouse.Cubes("server name", "00", "100", [Implementation="2.0", ExecutionMode=SapBusinessWarehouseExecutionMode.BasXmlGzip]),

    ZSCM_M01 = Source{[Name="ZSCM_M01"]}[Data],

    #"ZSCM_M01/ZSCM_M01_Q0201" = ZSCM_M01{[Id="ZSCM_M01/ZSCM_M01_Q0201"]}[Data],

    #"Added Items" = Cube.Transform(#"ZSCM_M01/ZSCM_M01_Q0201",

        {

            {Cube.ApplyParameter, "[!V000001]", {{"US01"}}},

            {Cube.ApplyParameter, "[!V000002]", {{"1100"}}},

            {Cube.ApplyParameter, "[!V000008]", {"[0CALMONTH].[201607]", "[0CALMONTH].[201607]"}},

            {Cube.AddAndExpandDimensionColumn, "[0MATERIAL]", {"[0MATERIAL].[LEVEL01]"}, {"Material.Material Level 01"}},

            {Table.AddColumn, "Material.Material Level 01.Material Level 01.UniqueName", each Cube.AttributeMemberProperty([Material.Material Level 01], "[MEMBER_UNIQUE_NAME]")},

            {Cube.AddMeasureColumn, "Total Stock", "[Measures].[00O2TQLIBWMYJDZIRV0N0BR17]"},

            {Cube.AddAndExpandDimensionColumn, "[0PLANT]", {"[0PLANT].[LEVEL01]"}, {"Plant.Plant Level 01"}},

            {Table.AddColumn, "Plant.Plant Level 01.Plant Level 01.UniqueName", each Cube.AttributeMemberProperty([Plant.Plant Level 01], "[MEMBER_UNIQUE_NAME]")}

        }),

    #"Sorted Rows" = Table.Sort(#"Added Items",{{"Material.Material Level 01.Material Level 01.UniqueName", Order.Ascending}})

in

    #"Sorted Rows"

 

2019-03-22_10-02-06.png

After I added Storage Location object and attributes

 

let

    Source = SapBusinessWarehouse.Cubes("server name", "00", "100", [Implementation="2.0", ExecutionMode=SapBusinessWarehouseExecutionMode.BasXmlGzip]),

    ZSCM_M01 = Source{[Name="ZSCM_M01"]}[Data],

    #"ZSCM_M01/ZSCM_M01_Q0201" = ZSCM_M01{[Id="ZSCM_M01/ZSCM_M01_Q0201"]}[Data],

    #"Added Items" = Cube.Transform(#"ZSCM_M01/ZSCM_M01_Q0201",

        {

            {Cube.ApplyParameter, "[!V000001]", {{"US01"}}},

            {Cube.ApplyParameter, "[!V000002]", {{"1100"}}},

            {Cube.ApplyParameter, "[!V000008]", {"[0CALMONTH].[201607]", "[0CALMONTH].[201607]"}},

            {Cube.AddAndExpandDimensionColumn, "[0MATERIAL]", {"[0MATERIAL].[LEVEL01]"}, {"Material.Material Level 01"}},

            {Cube.AddMeasureColumn, "Total Stock", "[Measures].[00O2TQLIBWMYJDZIRV0N0BR17]"},

            {Cube.AddAndExpandDimensionColumn, "[0PLANT]", {"[0PLANT].[LEVEL01]"}, {"Plant.Plant Level 01"}},

            {Table.AddColumn, "Plant.Plant Level 01.Plant Level 01.UniqueName", each Cube.AttributeMemberProperty([Plant.Plant Level 01], "[MEMBER_UNIQUE_NAME]")},

            {Cube.AddAndExpandDimensionColumn, "[0STOR_LOC]", {"[0STOR_LOC].[LEVEL01]"}, {"Storage Location.Storage Location Level 01"}},

            {Table.AddColumn, "Storage Location.Storage Location Level 01.Key (Not Compounded)", each Cube.AttributeMemberProperty([Storage Location.Storage Location Level 01], "[80STOR_LOC]")}

        }),

    #"Sorted Rows" = Table.Sort(#"Added Items",{{"Material.Material Level 01.Material Level 01.UniqueName", Order.Ascending}})

in

    #"Sorted Rows"

 

2019-03-22_10-02-06.png

Then I edited and clicked OK, but didn't select any new objects or make any other changes. 

 

let

    Source = SapBusinessWarehouse.Cubes("server name", "00", "100", [Implementation="2.0", ExecutionMode=SapBusinessWarehouseExecutionMode.BasXmlGzip]),

    ZSCM_M01 = Source{[Name="ZSCM_M01"]}[Data],

    #"ZSCM_M01/ZSCM_M01_Q0201" = ZSCM_M01{[Id="ZSCM_M01/ZSCM_M01_Q0201"]}[Data],

    #"Added Items" = Cube.Transform(#"ZSCM_M01/ZSCM_M01_Q0201",

        {

            {Cube.ApplyParameter, "[!V000001]", {{"US01"}}},

            {Cube.ApplyParameter, "[!V000002]", {{"1100"}}},

            {Cube.ApplyParameter, "[!V000008]", {"[0CALMONTH].[201607]", "[0CALMONTH].[201607]"}},

            {Cube.AddAndExpandDimensionColumn, "[0MATERIAL]", {"[0MATERIAL].[LEVEL01]"}, {"Material.Material Level 01"}},

            {Cube.AddMeasureColumn, "Total Stock", "[Measures].[00O2TQLIBWMYJDZIRV0N0BR17]"},

            {Cube.AddAndExpandDimensionColumn, "[0PLANT]", {"[0PLANT].[LEVEL01]"}, {"Plant.Plant Level 01"}},

            {Cube.AddAndExpandDimensionColumn, "[0STOR_LOC]", {"[0STOR_LOC].[LEVEL01]"}, {"Storage Location.Storage Location Level 01"}},

            {Table.AddColumn, "Storage Location.Storage Location Level 01.Key (Not Compounded)", each Cube.AttributeMemberProperty([Storage Location.Storage Location Level 01], "[80STOR_LOC]")}

        }),

    #"Sorted Rows" = Table.Sort(#"Added Items",{{"Material.Material Level 01.Material Level 01.UniqueName", Order.Ascending}})

in

    #"Sorted Rows"