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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
GGarnize
New Member

Change column as title in tableEx Embeeded

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 "

const regionColumn = { column: 'Region AS TEST', table: 'Geo', schema: 'http://powerbi.com/product/schema#column' };
But some error occured.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

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

 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.