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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
WouterBo
Helper II
Helper II

How can I add a measure selection to the Analytics Pane?

I am writing a custom visual using analytics lines in the analytics pane. Because my data may contain more than one measure, I would like to add a measure selection to each analytics line. The method for doing this in the formatting pane does not seem to work. What is the correct way of achieving this?

 

Currently my enumerateObjectInstances() function calls a method for each of the analytics lines in the analytics pane, which in turn loops through all the available measures and pushes an entry to the instanceEnumeration.containers array for each measure. This gives an index into the containers array like this:

 

 

const index = (<VisualObjectInstanceEnumerationObject>instanceEnumeration).containers.push({ displayName: currentColumn.displayName }) - 1;

 

 

Consequently, an object is pushed to the instanceEnumeration.instances array, referencing the correct container like this:

 

 

instances.push({
containerIdx: index,
objectName: Visual.dataColorsValuesColorPropertyIdentifier.objectName,
properties: {
valuesColor: someColor,
},
selector: { metadata: currentColumn.queryName }
});

 

 

This should result in a drop-down box being shown after adding an analytics line, containing a selection of the available measures. Although this method works for objects of the formatting pane, it does not work for the analytics pane. No drop down box is shown at all.

 

Is this method of adding containers supported for the analytics pane?

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi @WouterBo,

As per current doc, multiple instances aren't supported; only static ones. I've chased this up a few times over the last couple of years and there's no current ETA on when (or if) this will be resolved. If you want this functionality in the current ecosystem, you'll need to try and implement using the regular properties pane.

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)




View solution in original post

2 REPLIES 2
dm-p
Super User
Super User

Hi @WouterBo,

As per current doc, multiple instances aren't supported; only static ones. I've chased this up a few times over the last couple of years and there's no current ETA on when (or if) this will be resolved. If you want this functionality in the current ecosystem, you'll need to try and implement using the regular properties pane.

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)




Hi Daniel,

 

Thanks! Multiple instances isn't precisely what I was after. I am fine with having just the single instance of an analytics line, but I would like to have a switch that will allow me to select for which measure I draw any calculated analytics line. The MS visuals also have such a switch. That switch doesn't even save the rest of the settings separately for each of the measures, but I'd be fine with that.

My issue is that the regular strategy of adding a .container array to add the selection box only seems to work for the formatting pane, not the analytics pane.

If that is what you mean by multiple instances, than: my bad of course. 

 

Regards,

Wouter

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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