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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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