Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tonny_bwg
Helper I
Helper I

got the notification when creating a measure with SVG

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>"
1 REPLY 1
amitchandak
Super User
Super User

@tonny_bwg , End of the input means one of the Tag is not closing, take output the SVG code as Text and share

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.