Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hello,
In a Power BI report, we have a Table visual and a slicer. Both, the table and slicer are bound with a Field Parameter.
Field parameter looks like this:
The Table and the Slicer looks like this in Power BI desktop design view.
----
The report, after publishing, looks like below – in the browser.
In the browser, if I check [Full Name] checkbox in the Slicer then only Full Name column is visible in the Table; When both checkboxes are checked, then both columns/fields are visible in the Table, as shown in above picture. So far so good.
The report, after publishing, looks like below – in the browser.
Business Scenario: This report is embedded on client side in Asp.Net MVC application. The application has thousands of users, and each user can set the name of the column (here, Full Name and Start Time) in their own way. For example, User1 has kept the name of the Full Name column as Employee name; User2 has kept the name of the Full Name column as User name.
I have observed that, Power BI embed APIs can support changing the display name of the columns with this API/code as mentioned below.
Example, pseudo code: myTableVisual.setDataFieldDisplayName(mydatarole, 0, "Employee Name");
https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/display-name
Above code gives error: Invalid data field index, index is out of range.
To me it seems that, Field Parameters are not recognized the setDatFieldDisplayName function by the embedded API (here, in TypeScript language). If I put a table column (instead of Field Parameter) in the Table visual and then if try to change the display name of that column, then the API works.
In below image, User Action is a column of a table (and Field is a Field parameter).
I believe, if I can get the solution to set the display name for field parameters in the Table visual, then the same solution should also be applicable in the Slicer as well.
Please advise how to fulfill the business scenario that I have.
Thanks in advance,
Bhavnik