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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jhsimb
Frequent Visitor

Cube.CollapseAndRemoveColumns slow after List.Buffer

Using List.Buffer for filtering in a column improved performance, but applying collapse (column) caused a significant slowdown in the query. Any help to this problem? Thanks in advance.

 

2 REPLIES 2
v-jingzhan-msft
Community Support
Community Support

Hi @jhsimb 

How do you apply collapse (column)? Can you provide the M code you used?

 

Best Regards,
Jing

Hi, here is the code:

 

#"Vendedor BAANV" = Cube.Transform(#"Filtro Supervisor",
{
{Cube.AddAndExpandDimensionColumn, "[Piramide Ventas]", {"[Piramide Ventas].[Piramide Ventas].[Vendedor BAANV]"}, {"Vendedor BAANV"}}
}),
Cliente = Cube.Transform(#"Vendedor BAANV",
{
{Cube.AddAndExpandDimensionColumn, "[Cliente]", {"[Cliente].[Por Cliente].[Cliente]"}, {"Cliente"}}
}),
Medidas = Cube.Transform(Cliente,
{
{Cube.AddMeasureColumn, "No. Clientes Efectivos", "[Measures].[No. Clientes Efectivos]"},
{Cube.AddMeasureColumn, "No. Clientes Ruta", "[Measures].[No. Clientes Ruta]"}
}),
ListQuery = List.Buffer(Lista),
#"Filas filtradas" = Table.SelectRows(Medidas, each (List.Contains(ListQuery,[Cliente])<>true )),
#"Columnas contraídas y quitadas" = Cube.CollapseAndRemoveColumns(#"Filas filtradas", {"Cliente"})
in
#"Columnas contraídas y quitadas"

 

Thanks

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors