'How do I get each row in a table?

I'm a beginner in Power BI development.

I have a table which looks like this, it has 447 rows:

table with 2 columns

How do I configure my capabilites.json file to get the data from this table? I have two GroupingOrMeasure data fields in dataRoles and I limit each to be "max": 1.

The closest I got to get the table's data, is this property, which only returns the 'name' column values correctly:

"dataViewMappings": [
    {
        "categorical": {
            "categories": {
                "for": { "in": "name-col" }
            },
            "values": {
                "select": [
                    { "bind": { "to": "imports-col" } }
                ]
            }
        }

    }
]

But with this I don't get the 'imports' column's values, the dataView.categorical.categories has only one array.

My goal is to get both the 'name' and 'imports' column's value, the 'imports' column having multiple values associated to one value of the 'name' column's.

In most cases that I tried, that would return both columns, each source had far fewer values (around 83 each) and the 'name' source having each value listed only once.



Solution 1:[1]

Found the solution:

"table": {
    "rows": {
        "select": [
            { "for": { "in": "name-col" } },
            { "for": { "in": "imports-col" } }
        ]
    }
}

Correctly returns each row.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Flyingwarrior