Forum Discussion
Azure Map - Issue with Conditional formatting
- 13 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!😄
Thank you for looking into this.
I have tried checking the conditional formatting values. It is returning the expected value as shown in the tooltip screenshot. I have checked that and it is varying with different lines I am hovering over (as attached in screenshots below). Since I have kept a custom tooltip for the page, when I hover over the geometry, I am able to see the relevant Link ID as well.
The reason why I am unable to add the values as a table is because I am using a slicer so that my end-user can change the thresholds for the colour formatting, and the map will respond accordingly. (Attaching the screenshot of the slicers set below)
The reason why I believe the reference layer matches the link ID is because the tooltip response I am receiving is accurate. I am sharing the DAX I have set up for Link_Colour_Flag below for your reference:
Link_Colour_Flag =
VAR Start1 = MIN('Symbology Range - Link - Level 1'[Number])
VAR Start2 = MIN('Symbology Range - Link - Level 2'[Number])
VAR Start3 = MIN('Symbology Range - Link - Level 3'[Number])
VAR Start4 = MIN('Symbology Range - Link - Level 4'[Number])
VAR Start5 = MIN('Symbology Range - Link - Level 5'[Number])
VAR End1 = MAX('Symbology Range - Link - Level 1'[Number])
VAR End2 = MAX('Symbology Range - Link - Level 2'[Number])
VAR End3 = MAX('Symbology Range - Link - Level 3'[Number])
VAR End4 = MAX('Symbology Range - Link - Level 4'[Number])
VAR End5 = MAX('Symbology Range - Link - Level 5'[Number])
RETURN
SWITCH(
TRUE(),
AVERAGE([Value]) >= Start1 && AVERAGE([Value]) <= End1, "Level 1",
AVERAGE([Value]) > Start2 && AVERAGE([Value]) <= End2, "Level 2",
AVERAGE([Value]) > Start3 && AVERAGE([Value]) <= End3, "Level 3",
AVERAGE([Value]) > Start4 && AVERAGE([Value]) <= End4, "Level 4",
AVERAGE([Value]) > Start5 && AVERAGE([Value]) <= End5, "Level 5",
"Other"
)