Forum Discussion
Possible Bug in d3.scaling | EDIT: How to void grouping/categorizing data
- 8 years ago
This is expected behavior as Power BI aggregates the same values by using an algorithm such as Sum, Count, etc.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
anzahlKostenstellen is a PrimitiveValue but is used always as a <number>anzahlKostenstellen
I figured out what the problem was but still couldnt solve it.
In my table are two identical names.
For example if this is my original Table:
verantwortlicher gesamtKosten anzahlKostenstellen
Peter 200 3
Peter 500 5
Martin 100 1
Tom 400 9
It categorizes them together, which makes sense because my verantwortlicher is set to "Grouping" in my capabilities,json:
verantwortlicher gesamtKosten anzahlKostenstellen
Peter 200 3
Peter 500 5
Martin 100 1
Tom 400 9
But i dont want PBI to group it together. How can i do this?
My capabilities.json
{
"dataRoles": [
{
"displayName": "Verantwortlicher",
"name": "verantwortlicher",
"kind": "Grouping" // If i change this to "Measure", nothing works...
},
{
"displayName": "Gesamtkosten",
"name": "gesamtKosten",
"kind": "Measure"
},
{
"displayName": "Anzahl Kostenstellen",
"name": "anzahlKostenstellen",
"kind": "Measure"
}
],
"dataViewMappings": [
{
"table": {
"rows": {
"select": [
{ "for": { "in": "verantwortlicher" } },
{ "for": { "in": "gesamtKosten" } },
{ "for": { "in": "anzahlKostenstellen" } }
]
}
}
}
],
...My Interface:
interface ChartDataPoint {
verantwortlicher: string;
gesamtKosten: PrimitiveValue;
anzahlKostenstellen: PrimitiveValue;
color: string;
selectionId: ISelectionId;
};My visualTransform:
function visualTransform(options: VisualUpdateOptions, host: IVisualHost): ChartViewModel {
let dataViews = options.dataViews;
let rows = dataViews[0].table.rows;
let chartDataPoints: ChartDataPoint[] = [];
for (let i = 0, len = rows.length; i < len; i++) {
var row = rows[i];
chartDataPoints.push({
verantwortlicher: row[0] + '',
gesamtKosten: <number>row[1],
anzahlKostenstellen: <number>row[2],
color: null,
selectionId: null
});
}
return {
dataPoints: chartDataPoints
};
}
Thank you in advance!
This is expected behavior as Power BI aggregates the same values by using an algorithm such as Sum, Count, etc.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals