Forum Discussion
Conditional Formatting - createDataViewWildcardSelector with Grouped Data
Hi andrjohns,
I've spent a little while looking at this. Your code looks good to me, and I think it's probably worth checking with MS to see if this is supported or a bug. This repo is a good way for them to quickly confirm if something is wrong, or if there is something else to do to make it work.
For groupings, I would expect the DataViewValueColumnGroup returned by categorical.values.grouped() to contain an objects property with the derived conditional formatting values. This does not happen.
To show my working, I have downloaded your repo and created a data set that looks like this:
So:
- Category = Month Name (Date.Month Name)
- Grouping = Calendar Year (Date.Calendar Year)
- Measure = Deviation from Reference (Temperature Deviations.Deviation from Reference)
In my data view metadata, I get what I might expect: one entry for each field I added, then an additional four entries for the intersection of grouping x measure:
Expanding the last entry to confirm groupName of 2024 (last value of Calendar Year):
As I say, it's not a great example, but should hopefully demonstrate that things are happening as I expect so far.
When I try to add a measure to the conditional formatting field (we'll do an implicit measure of count of Calendar Year, because we have less entries in 2024 and can check the number is right), the array changes as follows:
Hopefully you will see that our array length is now 12 (up from 7). This is:
- One entry for the implicit measure (index #3)
- Four additional entries for measure x calendar year (entries #5, #7, #9 and #11)
If we expand the final entry, we can see that it is indeed for groupName = 2024, and there is an additional property called relatedObjects (which I have also expended for youto show its structure):
You should be able to see that this has dataPoint.fontSize in its structure.
However, this is not part of the API, so we shouldn't rely on it. We can also see that there is no corresponding derived value in there anyway.
This is as much as I could find in the data view (I also downloaded the raw data view to check for occurrences of the fontSize object and it's definitely not there).
So, long story short, I'd contact MS at [email protected], to see if they can confirm what is gong wrong here, and if it isn't a bug, what the correct implementation should be for this use case. It would defininitely be useful to provide them with your repo and this thread for reference.
Good luck,
Daniel
- andrjohns2 years ago
Helper II
Hi Daniel,
Thanks for taking the time to dive in and investigate, it's much appreciated! Great to hear that it's not just me missing something obvious, I'll contact support and see what they say.
Thanks again!