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
Fengshuki
Frequent Visitor

Total and Subtotal API returns no data with select-for-in expression

Hi,

 

I have been experimenting with the Total and Subtotal API using the sample matrix (GitHub - microsoft/Powerbi-Visuals-SampleMatrix: demonstrates a powerbi matrix custom visual) which works just fine in itself.
However, after modifying the capabilities.json of the sample by adding an additional data role and changing the data view mappings for the rows of the matrix to use the select-for-in expression to bind to data roles to it, the visual is not able to retrieve any data. If the total and subtotal API is disabled, the data view mapping works just fine.

 

It seems like it is not possible to use the select-for-in expression with the Total and Subtotal API. Did anyone else encounter this problem? 

 

The modified parts of the capabilities.json are as following:

  "dataRoles": [
    {
      "name": "Rows",
      "displayName": "Rows",
      "displayNameKey": "Visual_Rows",
      "kind": "Grouping"
    },
    {
      "name": "Columns",
      "displayName": "Columns",
      "displayNameKey": "Visual_Columns",
      "kind": "Grouping"
    },
    {
      "name": "Value",
      "displayName": "Value",
      "displayNameKey": "Visual_Values",
      "kind": "Measure"
    },
    {
      "displayName": "Filters",
      "name": "Filters",
      "kind": "Grouping"
    }
  ],
  "dataViewMappings": [
    {
      "matrix": {
        "rows": {
          "select": [
            {
              "for": {
                "in": "Rows"
              }
            },
            {
              "for": {
                "in": "Filters"
              }
            }
          ]
        },
        "columns": {
          "for": {
            "in": "Columns"
          }
        },
        "values": {
          "select": [
            {
              "for": {
                "in": "Value"
              }
            }
          ]
        }
      }
    }
  ],

 

Best regards

0 REPLIES 0

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.

Top Solution Authors