Forum Discussion
DataViewMappings for hierarchical data with partial filtering
Yes're correct. Power BI Custom Visuals API doesn't support multiple data-views at lest for now.
I suppose that you might use the table mapping for your case.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
How exactly could I do that?
Currently I have this:
{
"dataRoles": [
{
"displayName": "Category 1",
"name": "category",
"kind": "Grouping"
},
{
"displayName": "Category 1 & 2",
"name": "category2",
"kind": "Grouping"
},
{
"displayName": "Measure Data",
"name": "measure",
"kind": "Measure"
}
],
"dataViewMappings": [
{
"conditions" : [
{
"category": { "max": 1 },
"category2": { "max": 2 }
}
],
"table": {
"rows": {
"select": [
{ "bind": { "to": "measure" } },
{ "for": { "in": "category" } },
{ "for": { "in": "category2" } }
]
}
}
}
]
}Basically, I want the measures filtered by 'category' AND (completely separately) filtered by everything in 'category2'. That's not what this mapping does - how can I change it to get what I need?
For example: if Category and Subcategory are two columns in my data, I would be to put Category in the 'category' field and Category AND Subcategory in the 'category2' field. The filtering by 'category' would give the aggregate values per Category and filtering by 'category2' would give the values one level further down in the hierarchy, for each combination of Category and Subcategory.
- v-viig8 years agoCommunity Champion
As far as I understand you want to implement something like Drill down.
Is my understanding correct?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- PBIcustomizer8 years agoFrequent Visitor
In principle yes, but I want access to the different hierarchies all at once.
I tried using drill down, but then I only get one specific view- either the top level (only one category) or the data filtered on everything.
Is there a way to combine the hierarchies when using drill down? Maybe persisting the data from the higher levels?
- v-viig8 years agoCommunity Champion
As far as I know, Power BI doesn't support combining hierarchies.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals