cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bgirard
Regular Visitor

Order of fields in buckets

 

I just started developing a new custom visualisation. How do I get the field order in a bucket?   

 

I have a bucket named "Values" and let's say that I drag "Vente$", and then "Cost$".

Screenshot_5.png

 

The order of the DataViewCategoricalColumn s in dataView.categorical.values are Ventes$, first, Cost$ second as expected.

Now, if I drag Cost$, above Vente$ in the Valeurs bucket...

Screenshot_6.png

 

the dataView.categorical.values I get is exactly the same, in the same order (seems like the order in which the fields were added first to the bucket), regardless of what is the current fields order in the bucket. 

 

 

I know that other visualistion (like the table for exemple), the order of the displayed columns change when you reorder the field in the bucket.  So, where can I get the field bucket index? 

 

dataRoles definition;

{
  name: 'Values',
  kind: VisualDataRoleKind.GroupingOrMeasure,
}, {
  name: 'Gradient',
  kind: VisualDataRoleKind.Measure,
}

 

 

dataViewMappings defintion;

values: {                   
    select: [ { bind: { to: 'Values' } },{ bind: { to: 'Gradient' } }],
    dataReductionAlgorithm: { top: {} }
},

 

0 REPLIES 0

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.