Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi All,
So i've setup my custom visual to have 3 dataviews in its capabilities. It seems though that its just duplicating the first categorical data view for the other 2. Anyone got any ideas?
In the visual playground where i control the data view mapping inputted the visual renders correctly. So i'm assuming it has to do with how the service is mapping the inputs to the mappings below.
dataViewMappings: [
{
categorical: {
categories: {
for: { in: 'A' },
dataReductionAlgorithm: { top: {} }
},
values: {
group: {
by: 'B',
select: [{ for: { in: 'Values' } }],
dataReductionAlgorithm: { top: {} }
}
},
rowCount: { preferred: { min: 2 }, supported: { min: 0 } }
},
},
{
categorical: {
categories: {
for: { in: 'ACategory' },
dataReductionAlgorithm: { top: {} }
},
values: {
group: {
by: 'A',
select: [{ for: { in: 'Values' } }],
dataReductionAlgorithm: { top: {} }
}
},
rowCount: { preferred: { min: 2 }, supported: { min: 0 } }
},
},
{
categorical: {
categories: {
for: { in: 'BCategory' },
dataReductionAlgorithm: { top: {} }
},
values: {
group: {
by: 'B',
select: [{ for: { in: 'Values' } }],
dataReductionAlgorithm: { top: {} }
}
},
rowCount: { preferred: { min: 2 }, supported: { min: 0 } }
},
}
]
dataViewMappings correspond to the dataRoles. What does your dataRoles section look like?
You can only map once, so having three is not correct. Something like this may get you closer. Note how the roles match the mappings. The best way to learn is to find a chart that behaves the way that you want and start from that example. If you log the dataview to the console, you can experiment and see how changes you make to capabilities affect the dataview.
dataRoles: [
{
name: "A",
kind: VisualDataRoleKind.Grouping,
displayName: "A"
},
{
name: "B",
kind: VisualDataRoleKind.Grouping,
displayName: "B"
},
{
name: "Values",
kind: VisualDataRoleKind.Measure,
displayName: "Values"
}
],
dataViewMappings: [{
categorical: {
categories: {
for: { in: "A" }
},
values: {
group: {
by: "B",
select: [{ bind: { to: 'Values' } }]
}
},
}
}],
Hey Deldversveld,
Do you know for certain that you can only map once? Can you further iterate on that. Or are you saying that per data role you can only allocate to one datamapping?
If you take a look at the combo chart in the visualisation playground it has multiple dataviewmappings assosciated to it.
dataViewMappings: [
{
conditions: [
{ 'Category': { max: 1 }, 'Series': { max: 0 } },
{ 'Category': { max: 1 }, 'Series': { min: 1, max: 1 }, 'Y': { max: 1 } },
],
categorical: {
categories: {
for: { in: 'Category' },
dataReductionAlgorithm: { top: {} }
},
values: {
group: {
by: 'Series',
select: [
{ for: { in: 'Y' } }
],
dataReductionAlgorithm: { top: {} }
}
},
rowCount: { preferred: { min: 2 }, supported: { min: 0 } }
}
}, {
conditions: [
{ 'Category': { max: 1 }, 'Series': { max: 0 }, 'Y2': { min: 1 } },
{ 'Category': { max: 1 }, 'Series': { min: 1, max: 1 }, 'Y': { max: 1 }, 'Y2': { min: 1 } },
],
categorical: {
categories: {
for: { in: 'Category' },
dataReductionAlgorithm: { top: {} }
},
values: {
select: [
{ for: { in: 'Y2' } }
],
dataReductionAlgorithm: { top: {} }
},
rowCount: { preferred: { min: 2 }, supported: { min: 0 } }
},
}
],
thoughts?
I was thinking a long your lines until i saw the combo chart. I have my base visualisation working with the single data view mapping.
This is really to activate category colouring but with two groupings and a single measure. As opposed to a combo chart which is one grouping i.e. axis and two measures.
You're right! I had not looked at the capabilities for combo chart. No suggestions on a solution, but I'll try to look into it later tonight.
yeah cool okay, keen to see if you can find the way to do it.
Knocking my head over it, you should be able to do it if the combo chart works that way.
Were you able to find a solution to this? I am having the same struggle.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.