Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I'm trying to build a custom visual, there i need the data like what we have in tables. I drag two column into "Summize Category"(Category name) and one column into "Measure Data". In dataview array contains categorical in that categories has multiple column. But values showing for only first category. Is there anything i need to tweak in dataviewmapping.
The following json structure is data roles and Data View Mappings
{
"dataRoles": [
{
"displayName": "Summize Category",
"name": "myCategory",
"kind": "Grouping"
},
{
"displayName": "Measure Data",
"name": "myMeasure",
"kind": "Measure"
}
],
"dataViewMappings": [
{
"categorical": {
"categories": {
"for": {
"in": "myCategory"
},
"dataReductionAlgorithm": {
"top": {}
}
},
"values": {
"select": [
{
"bind": {
"to": "myMeasure"
}
}
]
}
}
}
]
}
Results of Data
"dataViews": [
{
"categorical": {
"categories": {
"0": {
"source": {
"roles": {
"myCategory": true
},
"type": {
"underlyingType": 1,
"category": null
},
"displayName": "day",
"queryName": "vthink_dev_database tipsData.day",
"expr": {
"_kind": 2,
"source": {
"_kind": 0,
"entity": "vthink_dev_database tipsData"
},
"ref": "day"
}
},
"values": [
"Sun",
"Sun",
"Sun",
"Sun",
"Sun",
"Sun",
"Sun",
"Sun",
"Sun",
"Sun",
"Sun"
]
},
"1": {
"source": {
"roles": {
"myCategory": true
},
"type": {
"underlyingType": 260,
"category": null
},
"format": "0",
"displayName": "id",
"queryName": "vthink_dev_database tipsData.id",
"expr": {
"_kind": 2,
"source": {
"_kind": 0,
"entity": "vthink_dev_database tipsData"
},
"ref": "id"
}
}
}
}
}
}
]
I think it'd be better to use table or matrix data-mappings instead of categorical:
{
"dataRoles": [
{
"displayName": "Summize Category",
"name": "myCategory",
"kind": "Grouping"
},
{
"displayName": "Measure Data",
"name": "myMeasure",
"kind": "Measure"
}
],
"dataViewMappings": [
{
"table": {
"rows": {
"select": [
{
"for": {
"in": "myCategory"
}
},
{
"for": {
"in": "myMeasure"
}
}
]
}
}
}
]
}Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
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.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |