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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to add custom field format in format pane like Multi KPI

Hi. I really appreciate anyone who can take a look at this. 

 

My question is how to show the enumerationObject in the format pane.
 
I am working on learning how to add custom field formatting in the format pane, just like the Multi KPI example. So I downloaded this visual from github and started to read and test the code. But after I ran sudo pbiviz start, I found the field formatting was blank, as shown in the graph. I didn't do any modification on the original code. But, if I ran sudo pbiviz package and import the packed file to powerbi, the field formatting had something. 

 

The code to add field formatting in the Multi KPI example:

 

public enumerateObjectInstancesWithSelectionId(
        options: powerbi.EnumerateVisualObjectInstancesOptions,
        displayName: string,
        selectionId: powerbi.visuals.ISelectionId,
        enumerationObject: powerbi.VisualObjectInstanceEnumerationObject = {
            containers: [],
            instances: [],
        },
    😞 powerbi.VisualObjectInstanceEnumerationObject {
        
        if (this.areOptionsValid(options)) {
            const { objectName } = options;

            const selector: powerbi.data.Selector = selectionId && selectionId.getSelector();

            this.addSettingsToContainer(
                objectName,
                displayName,
                ColorHelper.normalizeSelector(selector),
                enumerationObject,
                this.getSettings(this[objectName]),
            );
        }
        return enumerationObject;
    }
 

 

 

 Get blank field formatting after running pbiviz start:

Screen-Shot-2020-06-20-at-1.28.07-PM


Non-blank field formatting after importing the packed file

Screen-Shot-2020-06-20-at-1.28.38-PM

1 REPLY 1
dm-p
Super User
Super User

Hi @Anonymous,

Unfortunately this can't be done at present. The MS visuals have some special kind of allowance that makes the drop down work correctly and either building them locally or trying to create your own doesn't work the same way. 

There's an issue open in the GitHub project for this and currently has no ETA. A few of us have been waiting some time for it 😞

Not the answer you were hoping for, I'm sure, but might at least confirm you were thinking along the right lines... just not something that's actually fully implemented in the SDK...

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors