Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hello,
For a table I'm trying to build 2 slicers that should allow users to 1) dynamically show or hide some non-essential columns, 2) dynamically change the header of these columns to different languages (EN, FR, IT).
In order to recreate my problem in a smaller, simple PBIX file, I created:
1. A table of random data with 2 columns:
1. A table with the 3 languages to choose from in a slicer:
3. 2 sets of Field Parameters that get the list of columns that I want to hide/show:
Although replacing the original titles with new "fixed" ones works, it seems that using SELECTEDVALUE for the header of the Field Parameter returns nothing, so in the displayed table the headers are the original column headers:
I tried to pass the selected language value through a separate measure, using IFs instead of SWITCH, etc. but nothing seems to work as long as SELECTEDVALUE is used somewhere to get the user selection. Any other formula (like TODAY()...) does work to customize the headers.
On this forum and others I found many posts about this issue of SELECTEDVALUE not working to add a dynamic header to Field Parameters, but none seem to have a working solution:
Has anyone achieved this before? I wanted to attach a sample PBIX file but apparently you need to be a Super User to do that, and clearly I'm not 😕, so let me know if you need to see anything about my file or have any question.
Thanks for your attention. Olivier.
@oduc78
Field Paramter is basically a table which gets added to your data model.
While creating a table or calculated column in Power BI, capturing slicer selections in real-time/dynamically isn't feasible. Power BI constructs tables and columns before making them available on the report canvas. Any selection made on the canves is not visible to at the time of table contruction.
Hope this clarifies.
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thanks @Fowmy for your feedback, I was afraid so.
What would you suggest then to modify the headers of the columns of a table based on actions by the users? Group calculations inside Power BI? Or outside calculations in Tabular Editor? I haven't looked into those yet. I did look into Parameters in Power Query but that would require starting the queries again, which my customers won't be able to do.
For now the only alternative that I found instead of a selection on a slicer is to create as many tables as there are languages and use links to hide/show each table, which becomes very complicated to manage when you have 6 languages and several tables on different pages.
Regards, Olivier.
@oduc78
The column headings are determined by the metadata, and currently, it's not feasible to change them dynamically. An alternative approach would be to keep the column headers unchanged. Instead, create a measure and a text box above the column headers to display the selected language. Modify your measure to showcase values based on the language selection.
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thanks again @Fowmy for your feedback.
I do use this method already for many text boxes and slicer titles across my reports, with multiple measures that change value based on the language selected by the user.
However since my other goal is to have hideable/showable columns that can also have their width modified by users, it's not very compatible with unmovable texte boxes.
I will keep looking for other solutions with Power BI, unless the only possibility it to go full web-based.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
33 | |
16 | |
13 | |
10 | |
8 |
User | Count |
---|---|
59 | |
20 | |
12 | |
11 | |
10 |