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.

Reply
kyxyo
New Member

Cambiar una columna de una tabla desde panel de selección

Hola a  todos, me pueden ayudar por favor?

 

El asunto es el siguiente:

 

Quiero cambiar el campo de una tabla, de acuerdo a (cada punto corresponde al numero de la imagen):

1: Desde una lista de selección de campos que se encuentra desconectada de todas las tablas, (solo está para seleccionar el campo que se quiere poner en la tabla), y se hace como un filtro de selección unica.
2: Quisiera que al seleccionar un campo del punto anterior, en una tabla se muestre como columna aquella que tenga el nombre seleccionado , y varíe según se seleccione en el panel de filtrado (del punto anterior, ninguno de estos campos es una medida).

3: La tabla del punto anterior, se debe visualizar de forma similar a como se ve ésta tabla.

Muchas gracias!!

 

 

 

Sin título.png

5 REPLIES 5
v-jingzhang
Community Support
Community Support

Hi @kyxyo 

 

Sorry that I don't understand Spanish so I have difficulty understanding the meaning of the data in your screenshot. Please refer to this topic (Switch a visualized table column with slicer - Microsoft Power BI Community) and check if the topic and solutions there close to what you need.

 

In addition, from your screenshot, the data in point 2 does not completely equals to the selected value in point 1, instead the previous one contains the latter one. If the data to be displayed in point 2 table are all like this, you may need to split the contained values into a new column to be used.


Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

Hello @v-jingzhang ,

Thank you very much for your answer, but I would like if you can please look for another alternative more precise (if it's possible), I understand that the language issue did not allow us to have the necessary clarity, perhaps it wasn't very clear


Look, the idea is this:

- From a table that is not connecting to the data because the only functionality is to choose the Column, we generate a unique selection filter (which is point 1 of the image).

- I want the table that is in point 2 of the image, the first column to be the one that has been selected in the filter panel of the previous point. And it's changes according to selection (Point 1).

- Point 3 of the image is a reference of how the object of point 2 looks, if we can make it work.

Again, I thank you very much !!!!

________________________________________________

Hello @v-jingzhang

Thank you very much for your response, but I would like if you can please look for another alternative suddenly more precise, I understand that the subject of the language did not allow us to have the necessary clarity from the beginning, perhaps the concern is not very clear.


Look, the idea is as follows:

- From a table that is not connecting to the data because the only functionality is to choose the Column, we generate a unique selection filter (which is point 1 of the image).

- I want the table that is at point 2 of the image, the first column is the one that was selected in the filter panel of the previous point.

- Point 3 of the image is a reference of what the object of point 2 looks like, if we can make it work.

Again, I thank you very much!

Hi @kyxyo 

 

Sorry for the late reply. I created a demo with some sample data. Please download the .pbix file to check if it is what you need.

 

When not selecting any option from TableB, TableA will display all data. When selecting an option from TableB, TableA will only display the data related to the selected option.

122304.jpg

 

I created two measures to achieve this. Add M_Flag as a filter on TableA visual and set the value is 1.

M_selectedOption = SELECTEDVALUE(TableB[Select Country])
M_Flag =
IF (
    HASONEVALUE ( TableB[Select Country] ),
    IF ( SELECTEDVALUE ( TableA[Invoice Country] ) = [M_selectedOption], 1, 0 ),
    1
)

Kindly let me know if this helps.

Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

Hi @v-jingzhang , thanks for your answer.

But... isn't what I need. I don't need change the values, I need to changes te column. For example, when you select some value (Brazil in this case), this become in the first value of the table, like this:

NewSample.png

And so on, each time you select a different value, it becomes the first column of the table.

Hi @kyxyo 

 

Thanks for your description, now I get what you mean. The column name is meta data in the data model, currently it is not supported to be changed dynamically according to users' interaction operations in the report. However, I come up with a small trick to overcome this, you could download the .pbix file to check the result. 

 

1. Create a measure like below, it is used to display the selected option.

M_selectedOption = SELECTEDVALUE(TableB[Select Country],"All Countries")

 

2. Insert a blank button and use above measure as its button text. Turn off Icon/Outline/Fill/Title options of the button. Format the Button Text and Background the same as the table column headers.

122401.jpg

 

3. Drag the button on top of the table column header, hold on Ctrl key and click the table visual, then right click on the selected items and select Group > Group. Now the button and the table have been grouped. Select the button and turn on Maintain layer order to make it always on top of the table.

122402.jpg

 

Additionally, if you are open to change your data model to dynamically change the column headers, below are some topics about this. You could search with keyword "change column name dynamically" to find more ideas about this.

Solved: Dynamic/Variable Column Header Names Changing with... - Microsoft Power BI Community

Solved: Dynamic Column Name - Microsoft Power BI Community

Solved: Dynamically changing name ofthe column header - Microsoft Power BI Community

Solved: Dynamically Change Column Displayed name - Microsoft Power BI Community

 

Best Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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