cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ysapiyev Responsive Resident
Responsive Resident

How to set two categorical vew mapping

hi everyone,

 

I need to set two categoricl vew mapping. I looked to example of combo chart capabilities, however it does not work in my visual.

I have two categorial view, values in second are correct, however, categories are same as in first view. What can be the problem?

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-viig
Moderator

Re: How to set two categorical vew mapping

It's native Power BI visuals. Multi data views are not supported by Power BI Custom Visuals API.

Please also note this repo is deprecated. Pleae don't rely on code in this repo anymore.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

9 REPLIES 9
Moderator v-viig
Moderator

Re: How to set two categorical vew mapping

Do you want ot use two or more categories in your own custom visuals?

Can you share your current capabilities.json?

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

ysapiyev Responsive Resident
Responsive Resident

Re: How to set two categorical vew mapping

@v-viig

 

 

Here is my capabilities file. As I understood from tutorial on github, second dataviewmapping will result in two categorical data with different categories and values. When I use this code, I have two categorical data, but categories from first one also displayed in second one, whereas there is no "check_cat". At the same time, data for second categorical view displayed correctly.

{

  "supportsHighlight": true,
  "dataRoles": [
    {
      "displayName": "Item name compl",
      "name": "category",
      "kind": "Grouping"
    },
    {
      "displayName": "Dates",
      "name": "date",
      "kind": "Grouping"
    },
    {
      "displayName": "Dates well test",
      "name": "date_wr",
      "kind": "Grouping"
    },
    {
      "displayName": "check cat",
      "name": "check_cat",
      "kind": "Grouping"
    },
    {
      "displayName": "value1",
      "kind": "Measure",
      "name": "value1"
    },
    {
      "displayName": "value1 unit",
      "name": "value1_unit",
      "kind": "Measure"
    },

    {
      "displayName": "value2",
      "name": "value2",
      "kind": "Measure"
    },
    {
      "displayName": "value2 unit",
      "name": "value2_unit",
      "kind": "Measure"
    },
    {
      "displayName": "value3",
      "name": "value3",
      "kind": "Measure"
    },
    {
      "displayName": "value3 unit",
      "name": "value3_unit",
      "kind": "Measure"
    },
    {
      "displayName": "value4",
      "name": "value4",
      "kind": "Measure"
    },
    {
      "displayName": "value4 unit",
      "name": "value4_unit",
      "kind": "Measure"
    },
    {
      "displayName": "check val",
      "name": "check_val",
      "kind": "Measure"
    }
  ],
 
  "dataViewMappings": [
    {
      "categorical": {
        "categories": {
          "select": [
            {
              "for": {
                "in": "category"
              }
            },
            {
              "for": {
                "in": "date"
              }
            },
            {
              "for": {
                "in": "date_wr"
              }
            }
          ]
        },
        "values": {
          "group": {
            "by": "date",
            "select": [
              {
                "bind": {
                  "to": "value1"
                }
              },
              {
                "bind": {
                  "to": "value1_unit"
                }
              },
              {
                "bind": {
                  "to": "value2"
                }
              },
              {
                "bind": {
                  "to": "value2_unit"
                }
              },
              {
                "bind": {
                  "to": "value3"
                }
              },
              {
                "bind": {
                  "to": "value3_unit"
                }
              },
              {
                "bind": {
                  "to": "value4"
                }
              },
              {
                "bind": {
                  "to": "value4_unit"
                }
              }
            ]
          }
        }
      }
    },
    {
      "categorical": {
        "categories": {
          "select": [
           
            {
              "for": {
                "in": "check_cat"
              }
            }
          ]
        },
        "values": {
          "group": {
            "by": "check_cat",
            "select": [
              {
                "bind": {
                  "to": "check_val"
                }
              }
            ]
          }
        }
      }
    }
  ]
}
ysapiyev Responsive Resident
Responsive Resident

Re: How to set two categorical vew mapping

@v-viig,

 

Did you have a chance t look at my capavilities file? I'm stack at this problem.

Moderator v-viig
Moderator

Re: How to set two categorical vew mapping

As far as I know, Power BI Custom Visuals API doesn't support two or more dataViews.

Please use the single dataView in categories to resolve the issue.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

ysapiyev Responsive Resident
Responsive Resident

Re: How to set two categorical vew mapping

@v-viig,

 

Ok. Thank you. 

 

Since visuals don't support more than one dataview, why does combo chart's capabilities file have three of them?

Moderator v-viig
Moderator

Re: How to set two categorical vew mapping

What combo chart are you talking about?

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

ysapiyev Responsive Resident
Responsive Resident

Re: How to set two categorical vew mapping

Moderator v-viig
Moderator

Re: How to set two categorical vew mapping

It's native Power BI visuals. Multi data views are not supported by Power BI Custom Visuals API.

Please also note this repo is deprecated. Pleae don't rely on code in this repo anymore.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

ysapiyev Responsive Resident
Responsive Resident

Re: How to set two categorical vew mapping

@v-viig,

 

Ok, thank you.

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors