The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I Want to change in my 'tableEx', how header of column is shown.
I've been mounting the code in the 'embedded playground', and I can't do it there.
try {
await authoringPage.setActive();
const customLayout = {
x: 0,
y: 0,
height: 300,
width: 700,
displayState: {
mode: models.VisualContainerDisplayMode.Visible,
},
}
const response = await authoringPage.createVisual('tableEx', customLayout);
window.lastCreatedVisual = response.visual;
// Defining data fields
const regionColumn = { column: 'Region', table: 'Geo', schema: 'http://powerbi.com/product/schema#column' };
// Adding visual data fields
lastCreatedVisual.addDataField('Values', regionColumn);
}
I Want "Region" in my table, appear "TEST" for example... I Tried "
Solved! Go to Solution.
Try put this line:
await lastCreatedVisual.setDataFieldDisplayName('Values', 0, 'TEST');
In "setDataFieldDisplayName",
first parameter is DataRole that you want change display name;
second parameter is position, if you have 3 "Values" for example, you need pass who you want to change;
and the third parameter, is what you want display.
This line probably resolve your problem
Try put this line:
await lastCreatedVisual.setDataFieldDisplayName('Values', 0, 'TEST');
In "setDataFieldDisplayName",
first parameter is DataRole that you want change display name;
second parameter is position, if you have 3 "Values" for example, you need pass who you want to change;
and the third parameter, is what you want display.
This line probably resolve your problem
User | Count |
---|---|
5 | |
5 | |
2 | |
2 | |
2 |
User | Count |
---|---|
10 | |
7 | |
4 | |
4 | |
4 |