This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hey All, thank you for your help in advance!
I need to have my capabilities.json with the ability to have : One - Categoty data (for Id's) and One More seperated one that will be used to codeToText the id with some meaningfull data to the user for example some link or text...
In Data Source it looks like below :
123123123, Storm, ..... many more rows
9879789789, Rain, ..... many more rows
456456456, Snow, ..... many more rows
Elaboration -
id's list : (awalable to me in the code)
123123123, 9879789789, 456456456
codeToText list (this what the user will see in the visual table instead of id's):
Storm, Rain, Snow
I can define 2 deferent named sections of dataRoles but i cannot manage to define the dataViewMappings for both the dataRoles to have dataReductionAlgorithm applied in paralel ... could someone please help ?
Hi @DallasBaba , thank you for your response , i tried to you above example but unfortunately it does not pass compilation ... i will look into the links you gave me but im afraid that i will need some kind of a course of how to use the capabilities ....
@Anonymous, I'm sorry my example didn’t work for you. You can read more at Microsoft Learn.
Or try to define a Data Roles within capabilities.json, create two distinct dataRoles sections:
"dataRoles": [
{
"displayName": "Category Data",
"name": "categoryData",
"kind": "Grouping"
},
{
"displayName": "Code To Text Mapping",
"name": "codeToText",
"kind": "Measure"
}
]
Then configure Data View Mappings the fields from your data source to the corresponding data roles:
"dataViewMappings": [
{
"categorical": {
"categories": {
"for": {
"in": "categoryData"
}
}
}
},
{
"measure": {
"measures": {
"select": [
{
"bind": {
"to": "codeToText"
}
}
]
}
}
}
]
Apply Data Reduction Algorithm Within the dataViewMappings sections, specify the dataReductionAlgorithm for each data role
"dataViewMappings": [
{
/* ... category mapping ... */
"dataReductionAlgorithm": {
"top": {
"count": 100
}
}
},
{
/* ... codeToText mapping ... */
"dataReductionAlgorithm": {
"top": {
"count": 50
}
}
}
]
Ensure your visual's code handles the separate data roles correctly and applies the display and codeToText functionality mappings. Verify that the data types in your data source match the expected types for the data roles.
if my answers contribute to a solution, show your appreciation by giving it a thumbs up!
@Anonymous you can define two different named sections of dataRoles in your capabilities.json file :
"dataRoles": {
"categoryData": {
"displayName": "Category Data",
"kind": "Grouping",
"description": "Data used for grouping visuals",
"requiredTypes": [
"Text",
"Numeric",
"DateTime"
]
},
"codeToText": {
"displayName": "Code to Text",
"kind": "Grouping",
"description": "Data used for mapping codes to text",
"requiredTypes": [
"Text",
"WebUrl"
]
}
}
You can refer to the following resources to learn more about DataViewMappings and data reduction algorithms
https://github.com/PowerBi-Projects/PowerBI-visuals/blob/master/Capabilities/DataViewMappings.md
https://learn.microsoft.com/en-us/power-bi/developer/visuals/dataview-mappings
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |