Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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?
Solved! Go to Solution.
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
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 @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
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
User | Count |
---|---|
15 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
17 | |
11 | |
5 | |
4 | |
3 |