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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

3 category feeds - valid solution?

Hi everybody,


we were trying to get more distinguishable category feeds working with the categorical input (3 dimension feeds, 1 measure feed) and after some tinkering we came up with a solution. We want to do this, because we need the assignment of dimensions to three different feeds, so they are displayed on different axis.

 

The solution below gives us exactly the result we want!

 

BUT: We didn't find anything in the docs, if this setup is valid by any means. We heard from another source, that nested categories are not supported by Power BI. Now we are unsure, if using this is some kind of hack (or bug) or if this is valid and we can rely on it. That this is not gonna break in the future is very important, as it would be catastrophic for our customers.

 

So my question to you Power BI guys is: Is the setup below OK and valid? Can we be sure, this is gonna work in future API versions as well?

 

We are defining the dataRoles and dataViewMappings like this:

{
    ...
    "dataRoles": [
        {
            "displayName": "Rows",
            "name": "rowCategory",
            "kind": "Grouping"
        },
        {
            "displayName": "Columns",
            "name": "colCategory",
            "kind": "Grouping"
        },
        {
            "displayName": "Grouping",
            "name": "multiples",
            "kind": "Grouping"
        },
        {
            "displayName": "Measures",
            "name": "measure",
            "kind": "Measure"
        }
    ],
	...
	"dataViewMappings": [
        {
            "categorical": {
                "categories": {
                    "for": { "in": "rowCategory" }
                },
                "values": {
                    "group": {
                        "by": "colCategory",
                        "select":[
                            { "bind": { "to": "measure" } },
                            { "bind": { "to": "multiples" } }
                        ]
                    }
                }
            }
        },
        {
            "categorical": {
                "categories": {
                    "for": { "in": "multiples" }
                },
                "values": {
                    "group": {
                        "by": "colCategory",
                        "select":[
                            { "bind": { "to": "measure" } },
                            { "bind": { "to": "multiples" } }
                        ]
                    }
                }
            }
        }
    ]
}

 The output is something like below, having two categories for two dimensions/feeds and the third dimension/feed is used for value grouping.

...
	"dataViews: [{
        "tree": null, "table": null, "matrix": null, "single": null, "metadata": {
			"columns": [...]
		}, "categorical": {
			categories: [
				{...},
				{...}
			],
			"values": [
				{...},
				{...},
				{...}
			]
		}
	}]
...

 

 

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

I'm sorry that I couldn't find the relevant official documents to explain whether nested categories are supported or not. But now that this can work normally, it means it is supported. As for whether there is any potential problem or bug in the future, this is hard to say...

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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