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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
wellsayd
Frequent Visitor

Custom visual extract data from dataset

I have a column of 130 or so rows that contain either A,B,C,D,E,F ... When I try to access the 

table.rows, all of the duplicate rows have been grouped together with no indication of how many there are.
 
Preferably, I would like to access the data without PowerBi grouping the duplicates and allow me to do my own analysis in Typescript.
 
Any suggestions and thank you.
9 REPLIES 9
v-viig
Community Champion
Community Champion

Grouping is default behavior of Power BI.

The possible solution here is to add a Measure column to capabilities.json and put the main data column as Count of elements.

This solution will allow your custom visual to get how many items are there.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Thank you for your response. I am currently digging around for examples for what you are describing ... Currently, I have 

 

{
"dataRoles": [
  {
    "displayName": "Values",
    "name": "values",
    "kind": "Grouping"
  }
],
"dataViewMappings": [
 {
   "table": {
      "rows": {
         "for": {
            "in": "values"
          }
      }
    }
  }
 ]
}
 
Any suggestions would be much appreciated.


Ok I think I have what you are describing.

 

{
  "dataRoles": [
    {
            "displayName": "Category",
            "name": "Category",
            "kind": "Grouping"
        },
        {
            "displayName": "Values",
            "name": "Values",
            "kind": "Measure"
        }
  ],
  "dataViewMappings": [
      {

          "table": {
              "rows": {
                  "for": {
                      "in": "values"
                  }
              }
          }
      }
  ]
}



Then in the Values Field, select the drop down and select Count. See attached screen shot as a reference. 


example.jpg

Is there anyway to make the Count automatically occur?

 

Also, with the previous workflow ... all of the null or missing fields do not receive a count and it is part of the requirements.

 

Thank you for help !!

v-viig
Community Champion
Community Champion

As far as I know, there's no way to use Count by default.

 

Regarding null issue. It seems you should turn on "Shows items with no data":

 

image.png

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Thank you for the help.

 

The null value appears when you are just displaying the field.

 

But, the null value dissappears when you apply Count to the field.

 

Please see screenshots as a reference.

example1.jpgexample2.jpg

v-viig
Community Champion
Community Champion

Looks like it's limitation of categorical data view mapping.

We'd recommend that you should try table view mapping out.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

I am using table view mapping. 

v-viig
Community Champion
Community Champion

Power BI doesn't support Count aggregation for null values.

You might propose an idea to support Count for null values.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors