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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
b4ckup
Regular Visitor

DataView holds values even though the Measure was removed

Hi,

Today I encountered some strange behavior with the update call to my custom visual.

I have a custom visual with the following dataViewMappings

"dataViewMappings": [
    {
      "categorical": {
        "categories": {
          "for": {
            "in": "x"
          },
          "dataReductionAlgorithm": {
            "window": {
              "count": 1000000
            }
          }
        },
        "values": {
          "group": {
            "by": "legend",
            "select": [
              {
                "for": {
                  "in": "y1"
                }
              },
              {
                "for": {
                  "in": "y2"
                }
              }
            ],
            "dataReductionAlgorithm": {
              "top": {
                "count": 60
              }
            }
          }
        }
      }
    }
  ],

I now create a new instance of my custom visual in powerbi service and add a measure to the x dataview mapping. In the update function the first thing I do is log the options argument

public update(options: VisualUpdateOptions) 
{
    console.log(options)
    //...further irrelevant code here
}

 What I see is I get dataViews[0].categorical filled with some structure.

No I remove the Measure from my visual but dataViews[0].categorical still remains the same in the next update call. Even dataViews[0].metadata has an element that indicates that the x dataViewMapping is filled, which it isn't anymore. The same holds true if I fill any other dataViewMapping and then remove it. The behavior is not restricted to x.

Also when I fill two dataViewMappings like x and y and I delete for example y then the dataView I get as argument in update() no longer holds values or metadata for the y measure. This is the behavior I expected.

Did anybody also run into this issue? Is there maybe an underlying reason for this or does this even make sense somehow?

 

Thanks in advance

0 REPLIES 0

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors