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

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

Reply
oduc78
Helper I
Helper I

SELECTEDVALUE doesn't work to add a dynamic header to Field Parameters

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:

oduc78_1-1705047150481.png

1. A table with the 3 languages to choose from in a slicer:

oduc78_0-1705047103532.png

3. 2 sets of Field Parameters that get the list of columns that I want to hide/show:

  • one with modified but fixed headers for the columns
  • one with column headers that change dynamically depending on the selected language, by using SWITCH and SELECTEDVALUE

oduc78_5-1705049823639.png

 

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:

oduc78_3-1705048338665.png

 

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.

4 REPLIES 4
Fowmy
Super User
Super User

@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.


Did I answer your question? Mark my post as a solution! and hit thumbs up


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.




Did I answer your question? Mark my post as a solution! and hit thumbs up


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.

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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