Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
We have a predefined list of columns (e.g., Col1 to Col50) from which users can select multiple columns. The report includes 10 table visualizations, and each one should display data from one of the selected columns.
If the user selects more than 10 columns, only the first 10 selected columns should be used — each column should be mapped automatically to one of the 10 table visualizations.
Example:
If the user selects 15 columns out of the available 50, only the first 10 selected columns will be displayed across the 10 table visuals, with each table showing one selected column.
Approach followed : Used parameter slicer to select the column list where user can select multiple columns. Able to get the first 10 selected columns using the measure but unable to map columns dynamically to the tabular visualizations
Solved! Go to Solution.
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.
Input1-MainTable :
col1 | col2 | col3 |
a | a1 | a2 |
a | a1 | b2 |
a | b1 | c2 |
b | b1 | d2 |
b | c1 | e2 |
b | c1 | d2 |
input2-UserselectedColumns :
ColumnName |
col1 |
col2 |
Viz1 | Viz2 | |||||
Col1 | Count | Col2 | Count | |||
a | 3 | a1 | 2 | |||
b | 3 | b1 | 2 | |||
c1 | 2 |
@pk3130 Hey,
I will follow below method as per your latest input.
1) Make sure you have a parameter table that lists all columns
2) Use the UserselectedColumns[ColumnName] to create a slicer where users can select multiple columns.
3) Create measures for dynamic counting based on selected columns.
Col1Count =
VAR SelectedCol1 = SELECTEDVALUE(UserselectedColumns[ColumnName], "col1")
RETURN
CALCULATE( COUNT(MainTable[ColumnName]), MainTable[True] = TRUE() )
4) Ensure each table visual dynamically interacts with the selected column measure.
5) Use columns col1 and colcount1 for your first table visual.
follow by rest column
Thanks
Harish KM
If these steps help resolve your issue, your acknowledgment would be greatly appreciated.
Thanks @HarishKM ,
I see one issue with above solution lets say for first viz we selected col1 but what if customer didn't select col1 itself. Then still we will be showing the data of col1 which is not expected
Hi @pk3130,
Thank you for reaching out to the Microsoft fabric community forum. I reproduced the scenario again, and it worked on my end. I used my sample data and successfully implemented it.
Outcome:
For other tables also you can follow same like this mentioned in the .pbix file. I am also including .pbix file for your better understanding, please have a look into it:
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
Hi @pk3130,
Just checking in to see if the issue has been resolved on your end. If the earlier suggestions helped, that’s great to hear! And if you’re still facing challenges, feel free to share more details happy to assist further.
Thank you!
Hi @pk3130,
Hope you had a chance to try out the solution shared earlier. Let us know if anything needs further clarification or if there's an update from your side always here to help.
Thank you.
Hi @pk3130,
Just wanted to follow up one last time. If the shared guidance worked for you, that’s wonderful hopefully it also helps others looking for similar answers. If there’s anything else you'd like to explore or clarify, don’t hesitate to reach out.
Thank you.
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.
Thanks @v-kpoloju-msft for the solution.
bit hesitate in pivoting it as the data is going to be huge, Is it possible also to add dyamic table visualizations based on columns in SelectedTableColumns. For Example if SelectedTableColumns has 3 columns then then report automatically has to create 3 table visualizations
Example : lets says we created 10 table visualizations but user has populated data only for 6 columns then the rest 4 table visualizations are going to be empty.
Other issue that i observed is when i select one of the record in one of the visualization then the data in all the visualizations within the report will be filtered but with this approach that is not the case, Any thoughts on this ?
Hi @pk3130,
Thanks for the great follow-up. You have raised three very valid points especially around performance, visual flexibility, and native interactivity.
Performance concern with unpivoting large data: You are right unpivoting a wide table (like 50 columns) on a large dataset can increase memory usage. If your dataset is very large, I would recommend testing it on a sample slice to assess the impact.
Alternatively, the Field Parameters feature (explained below) avoids the need to unpivot entirely.
Dynamic number of visuals based on selected columns: Power BI does not support creating visuals dynamically. However, you can simulate this by:
This approach gives users a clean experience by showing only the relevant visuals.
Cross-filtering between visuals: This is a known limitation with disconnected slicer-based setups or unpivoted data. Since these visuals do not share a natural relationship, clicking one does not filter the others.
To retain native cross-filtering behaviour, I would recommend exploring Field Parameters a newer feature that allows users to select multiple columns in a slicer and display them in a single table visual, while retaining native interactivity.
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.
Hi @pk3130,
Just checking in to see if the issue has been resolved on your end. If the earlier suggestions helped, that’s great to hear! And if you’re still facing challenges, feel free to share more details happy to assist further.
Thank you.
We have a predefined list of columns (e.g., Col1 to Col50) from which users can select multiple columns. The report includes 10 table visualizations, and each one should display data from one of the selected columns.
If the user selects more than 10 columns, only the first 10 selected columns should be used — each mapped automatically to one of the 10 table visualizations.
Example:
If the user selects 15 columns out of the available 50, only the first 10 selected columns will be displayed across the 10 table visuals, with each table showing one selected column.
You might be better off using Small Multiples visuals, and Field Parameters for your columns to be used as the legend field.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Thanks @lbendlin
As requested here is the file. It has three sheets.
Input1-MainTable : This is the main table which has the customer data of all the columns
input2-UserselectedColumns : This is the table where we will load only the required columns based on the user selection, inshort this table will have columns that are required to show in Visualizations.
Ouput : Exepcted Table Viz
https://docs.google.com/spreadsheets/d/1XgzhaHq1wA1k0X6jEvjWbo-EOzUPCNAH/edit?usp=sharing&ouid=10089...
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.
User | Count |
---|---|
75 | |
75 | |
45 | |
31 | |
27 |
User | Count |
---|---|
99 | |
89 | |
52 | |
48 | |
46 |