DAX measures to create SVG images for use in table and matrix visuals
_Range Bar Normalised =
VAR MAXSales = MAX(financials[Gross Sales])
VAR MINSales = MIN(financials[Gross Sales])
VAR AVGSales = AVERAGE(financials[Gross Sales])
VAR AXISMAXRANGE = CALCULATE(MAX(financials[Gross Sales]),ALL(financials))
VAR AXISMINRANGE = CALCULATE(MIN(financials[Gross Sales]),ALL(financials))
VAR AXISRANGE = AXISMAXRANGE-AXISMINRANGE
VAR MAXNODE = MAXSales/AXISMAXRANGE*100
VAR MINNODE = MINSales/AXISMAXRANGE*100
VAR AVERAGENODE = AVGSales/AXISMAXRANGE*100
RETURN
IF(HASONEVALUE(financials[Country]),
"data:image/svg+xml;utf8," & "
<svg width='100' height='20' viewBox='-5 -5 105 25' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' overflow='visible'>
<rect id='track' x='0' y='2' width='100' height='18' fill='transparent'/>
<rect id='track' x="&"'"&MINNODE&"'"&" y='9' width="&"'"&MAXNODE&"'"&" height='2' fill='black'/>
<rect id='minmarker' x="&"'"&MINNODE&"'"&" y='1' width='2' height='20' fill='black'></rect>
<circle id='avgmarker' cx="&"'"&AVERAGENODE&"'"&" cy='10' r='3' width='2' height='20' fill='red'></circle>
<rect id='maxmarker' x="&"'"&MAXNODE&"'"&" y='1' width='2' height='20' fill='black'></rect>
</svg>
", BLANK())