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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jbrundagejr
Regular Visitor

dataViewMapping to include other CSV column

Hey friends:

 

New to PowerBI custom visuals and my problem is this. I'm importing a CSV which each column being a set of data. I need the first column which identifies each value to be returned with the column I'm selecting so I can build a JSON object everytime I import a column. My current work around is to have the user always import the terms as the first item and then add on as they select the funds they want to see, but this is not viable. Any help on how I can always have the first column (terms) be returned in the same object as other columns (fundData) I'm adding would be greatly appreciated!!

 

My curreent capabilities.json:

{

"dataRoles": [
  {
    "displayName": "Terms",
    "name": "terms",
    "kind":"Grouping"
  },
  {
    "displayName": "Fund Data",
    "name": "fundData",
    "kind": "Grouping"
  }
],
"dataViewMappings": [
    {
      "conditions": [
        {
          "terms": {
            "max": 1
          }
        }
      ],
      "categorical": {
          "categories": {
            "select": [
               {"for": {"in": "terms"}},
               {"for": {"in": "fundData"}}
             ]
          },
         "values": {
            "select": [
              {"bind": {"to": "fundData"}}
            ]
         }
      }
    }
]
}
3 REPLIES 3
Anonymous
Not applicable

HI @jbrundagejr,

According to your description, I think these parts should be more related to data structure shaping.
In my opinion, I'd like to suggest you do these data structure changes on the query editor side instead of processing them in custom visual codes. (notice: if you add the processing into the visual codes, they will be binding with a specific structure, you need to manually modify these codes every time data structure changes)

Regards,

Xiaoxin Sheng

Thanks for the reply, but how do I ensure my chart gets the correct information if not through the data view mapping? Isn't that the whole point of it? If a user can change the input everytime, how do I chose between categorical/table/matrix?

Anonymous
Not applicable

Hi @jbrundagejr,

In fact, I mean you did not input too complex data mapping in the visual itself.

Normally power bi will do these on the query edit side to analyze data source and change data structure then convert to the common data tables. 

For the visual itself, you only need to set some general data category/fields mappings.

Understand data view mapping in Power BI visuals - Power BI | Microsoft Docs

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.