I have a powerbiembedded report. I need to change the data field in one of the visual of the report. I looked through the API but couldn't find one. Can Any one help me how can i can change the dispaly name using API.
setDataFieldDisplayName
can be used to change the data field of the visual.
const oldDisplayName = await lastCreatedVisual.getDataFieldDisplayName('Y', 0);
const newDisplayName = "NEW_DISPLAY_NAME"; // New DisplayName to be Updated
await lastCreatedVisual.setDataFieldDisplayName('Y', 0, newDisplayName)
References: Visual Descriptor SetDataFieldDisplayName