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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
varutvu
Regular Visitor

Utilice la segmentación para seleccionar la columna que desea sumar

Hola a todos,

Tengo una mesa con 30 columnas, digamos C1... C30. Y necesita crear un panel donde un usuario pueda usar la segmentación de datos para elegir qué columna sumar y generarla en un gráfico. Por ejemplo, cuando el usuario selecciona C7 en la segmentación de datos, el gráfico traza una suma de columna [C7].

Sé que una manera de lograr esto es crear 30 medidas y usar la función SWITCH(). Pero, ¿hay alguna manera de crear una sola medida y un nombre de columna de referencia con una variable?

¡Gracias!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Si puede utilizar el editor de consultas, seleccione C1... C30 y haga clic en columnas despivot. Eso le permitirá hacerlo fácilmente con un solo cálculo.

Karlos_0-1597574313986.png

Karlos_1-1597574327172.png

También debería poder utilizar la función UNION en DAX, consulte a continuación un ejemplo

https://stackoverflow.com/questions/50213905/is-it-possible-to-unpivot-in-power-bi-using-dax

View solution in original post

2 REPLIES 2
AllisonKennedy
Community Champion
Community Champion

@varutvu
Estoy de acuerdo con @Karlos
Sin saber más acerca de qué datos hay en las columnas 1 - 30, también creo que esto suena como datos que podrían ser mejor sin votar.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Si puede utilizar el editor de consultas, seleccione C1... C30 y haga clic en columnas despivot. Eso le permitirá hacerlo fácilmente con un solo cálculo.

Karlos_0-1597574313986.png

Karlos_1-1597574327172.png

También debería poder utilizar la función UNION en DAX, consulte a continuación un ejemplo

https://stackoverflow.com/questions/50213905/is-it-possible-to-unpivot-in-power-bi-using-dax

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Kudoed Authors