Forum Discussion
Power BI dynamic visualizations
- 1 year ago
Power BI cannot work with encrypted Excel files.
Confidential - Microsoft Extended:DESCRIPTION Data is classified and protected. Microsoft Full Time Employees (FTE) and non-employees can edit, reply, forward and print. Recipient can unprotect content with the right justification.
Hi v-kpoloju-msft ,
Thanks for the prompt reply.
1. You have a DataTable which is in Unpivoted form, But my data is pivoted form
Ex: Columns of my datatable are Col1,col2,col3 and so on.
Hi pk3130,
Thank you for bringing the follow-up question. Below I provided one workaround that might be resolve your query. Go through it once.
I understand that you are using a parameter-based slicer to allow users to select multiple columns (from a predefined set of 50), and you have successfully retrieved the first 10 selected columns using DAX logic. However, you are facing difficulty mapping each of these 10 selected columns dynamically to 10 separate table visuals.
Power BI does not currently support dynamic column binding in visualizations. This means that while DAX can calculate or return dynamic column names based on user selection, it cannot dynamically change the actual field displayed in a visual (such as a table or chart). Visual fields must be statically defined at design time.
This is why the selected column names cannot be directly mapped to visuals the visuals require fixed schema references. The workaround is mentioned beow:
Unpivot the 50 columns into rows using Power Query (i.e., transform Col1–Col50 into Attribute and Value columns). Create a disconnected table listing all column names (Col1 to Col50) and use that in a slicer for user selection. Use DAX logic to assign an index (1 to 10) to the first 10 selected columns.
In each of the 10 visuals, filter the unpivoted data by matching the visual index (1–10) with the selected attribute. This simulates dynamic assignment each visual displays the values for one of the selected columns. Only the first 10 selected columns will be shown, and each one will appear in its respective table visual.
Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.
Thank you for using the Microsoft Community Forum.