Dear Gurus:
the first time to use SVG with DAX, got system notification“ the end of the input was reached”. does anybody help me out? what is the best approach to debug it.
Thanks
test_Inventroy =
VAR _CurrentPeriod = MAX('BS'[ReportDate])
VAR _PreviousPeriod = CALCULATE(MAX('BS'[ReportDate]), DATEADD('BS'[ReportDate], -1, MONTH))
VAR _PreviousYear = CALCULATE(MAX('BS'[ReportDate]), SAMEPERIODLASTYEAR('BS'[ReportDate]))
RETURN
DIVIDE(
SUM('BS'[Value]),
1000
) & "K" &
"<br>" &
"<svg width='12' height='12'>" &
"<polyline points='3,3 9,3 6,9' stroke='" &
IF(
SUM('BS'[Value]) > CALCULATE(SUM('BS'[Value]), DATEADD('BS'[ReportDate], -1, MONTH)),
"#00cc00", // green arrow
"#ff0000" // red arrow
)
& "' stroke-width='2' fill='none' transform='" &
IF(
SUM('BS'[Value]) > CALCULATE(sum('BS'[Value]), DATEADD('BS'[ReportDate], -1, MONTH)),
"rotate(-45 6 6)", // green arrow
"rotate(135 6 6)" // red arrow
)
& "' />" &
"<text x='0' y='10' font-size='8'>" &
IF(
SUM('BS'[Value]) > CALCULATE(SUM('BS'[Value]), DATEADD('BS'[ReportDate], -1, MONTH)),
"↑", // green arrow
"↓" // red arrow
)
& "</text>" &
"</svg>" &
"<span style='font-size: 10px;'>" &
"MoM: " &
FORMAT(
DIVIDE(
SUM('BS'[Value]),
CALCULATE(SUM('BS'[Value]), DATEADD('BS'[ReportDate], -1, MONTH))
) - 1,
"0.00%"
) &
"<br>" &
"YoY: " &
FORMAT(
DIVIDE(
SUM('BS'[Value]),
CALCULATE(SUM('BS'[Value]), SAMEPERIODLASTYEAR('BS'[ReportDate]]))
) - 1,
"0.00%"
) &
"</span>"