Forum Discussion
Azure Map - Issue with Conditional formatting
- 12 days ago
Hi v-abhinavmu and ShahRukhSameer
Thanks so much for your response and for the time you've taken to help with my query, I really appreciate it. I did try these approaches as well, but unfortunately, they didn't resolve the issue in my case.
After some further digging, I traced the problem back to the WKT/geometry of the shapefile I was uploading. Within the shapefile, the Line feature has a geometry type of MultiLineString. The Azure Maps visual does support MultiLineString geometry via shapefiles (and not other formats), so that part was fine.
The actual issue was that my Line had a disjoined geometry as a result of spatial processing. As you can see in the screenshot below, the Line is split into 3 separate parts whose ends don't connect.
Even though this disjoined Line still carries a MultiLineString geometry type, Azure Maps does not support disjoined features. The root cause turned out to be a cardinality/binding problem rather than a data problem: Azure Maps applies data-driven styling per feature. A LineString is a single feature (so it colours correctly), but a MultiLineString is one row holding N sub-parts, and the styling binder doesn't distribute reliably across them - so it drops the fill.
This also helped me rectify a related issue I was facing. I had been uploading the WKT geometry as a CSV, and none of the Lines were getting coloured. Once I geoprocessed the shapefiles to have a LineString geometry (rather than MultiLineString), I was able to upload the CSV as a Reference Layer directly — and the Lines rendered and coloured correctly.
Hope this helps anyone running into something similar!😄
Hi FirzanaShuja,
I think the first thing I'd check is whether the conditional formatting is actually returning the expected value for each Link ID.
You could put the Link ID and your Link_Colour_Flag field into a simple table visual and see if you're getting Level 1, Level 2, Level 3, etc. for the correct links.
If that looks correct in the table but the Azure Map isn't showing the different colours, then it may be related to how the reference layer is handling the conditional formatting. In particular, if Link_Colour_Flag is a measure, I'd try using a column instead if that's possible.
For example, something like:
Link ID | Colour Level
8500005-870006 | Level 2
8500005-870007 | Level 3
8500005-870008 | Level 1
Then use the Colour Level column for the formatting rules.
I'd also check that the Link ID being used by the reference layer matches the Link ID in your data exactly. Even small differences can cause the formatting to behave unexpectedly.
If you post the DAX you're using for Link_Colour_Flag, I can take a look at that as well. That may help narrow down whether it's a filter-context issue or something specific to the Azure Maps reference layer.