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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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