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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
matthias_vc
Frequent Visitor

how to determine column order for table dataViewmapping with multiple measures

Hi I'm creating a custom visual and have used the standard table dataViewMapping

 

"dataViewMappings": [
        {
            "table": {
                "rows": {
                    "select": [
                        {
                            "for": {
                                "in": "category"
                            }
                        },
                        {
                            "for": {
                                "in": "measure"
                            }
                        }
                    ]
                }
            }
        }
    ],

 

It parses the results just fine.

 

"table":{
  "columns": [
    {
      "roles": {...},
      "type": {...},
      "format": undefined,
      "displayName": "Category",
      "queryName": "Product.Category",
      "expr": {...},
      "rolesIndex": {...},
      "index": 0,
      "identityExprs": [..]
    },
    {
      "roles": {...},
      "type": {...},
      "format": "#,0.00",
      "displayName": "Measure1",
      "queryName": "Avg(Sales.Unit Price)",
      "expr": {...},
      "rolesIndex": {...},
      "index": 1,
      "isMeasure": true,
      "aggregates": [..]
    },
    {
      "roles": {...},
      "type": {...},
      "format": "#,0.00",
      "displayName": "Measure2",
      "queryName": "Sum(Sales.Sales)",
      "expr": {...},
      "sort": 1,
      "sortOrder": 0,
      "rolesIndex": {...},
      "index": 2,
      "isMeasure": true,
      "aggregates": [...]
    }
  ],
  "identity": [...],
  "identityFields": [...],
  "rows": [...]
}

 

However I want to know the order in which  the Measures are listed by the user in "Measure Data". If you look at a normal table, the columns get switched when you swap the order in the Data Fields Pane.
I don't see that change happening in the DataView.
How can I check what the order is of the measures?

0 REPLIES 0

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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