Forum Discussion

powerbiexpert22's avatar
powerbiexpert22
Impactful Individual
2 years ago
Solved

card with segretion using bars

can it be possible to create below card in power bi ?. i tried using new card and create sperate chart but unable to combine both

pbix:

https://docs.google.com/spreadsheets/d/1VaOgc2zCR_lbG8CCtYvH4JYkynYvlfZ5/edit?usp=drive_link&ouid=107010240500343952141&rtpof=true&sd=true

 

data:

https://drive.google.com/file/d/1l8NKF3K3iss5Mjwt05TqiiqRlxAz2AN_/view?usp=sharing

 

 

 

 

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi powerbiexpert22 

     

    Please try this:

    First of all, I create a SVG measure:

    Measure = 
    "data:image/svg+xml;utf8,
    <svg xmlns='http://www.w3.org/2000/svg' width='100' height='10'>
    <rect x='0' y='0' width='"&100*[Private Count]&"' height='10' fill='deepskyblue'/>
    <rect x='"&100*[Private Count]&"' y='0' width='"&100*[Public Count]&"' height='10' fill='blue'/>
    <rect x='"&100*[Private Count]+100*[Public Count]&"' y='0' width='"&100*[Business Count]&"' height='10' fill='red'/>
    <text x='"&100*[Private Count]&"' y='7' text-anchor='end' font-size='5'>"&100*ROUND([Private Count],2)&"%" &"</text>
    <text x='"&100*[Private Count]+100*[Public Count]&"' y='7' text-anchor='end' font-size='5'>"&100*ROUND([Public Count],2)&"%" &"</text>
    <text x='100' y='7' text-anchor='end' font-size='5'>"&100*ROUND([Business Count],2)&"%" &"</text>
    </svg>"

    Then add a new card:

    Next, click formatting > visual > Images

    Open the Image and select image url in image type:

    The result is as follow:

     

    Best Regards

    Zhengdong Xu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi powerbiexpert22 

     

    Please try this:

    First of all, I create a SVG measure:

    Measure = 
    "data&colon;image/svg+xml;utf8,
    <svg xmlns='http://www.w3.org/2000/svg' width='100' height='10'>
    <rect x='0' y='0' width='"&100*[Private Count]&"' height='10' fill='deepskyblue'/>
    <rect x='"&100*[Private Count]&"' y='0' width='"&100*[Public Count]&"' height='10' fill='blue'/>
    <rect x='"&100*[Private Count]+100*[Public Count]&"' y='0' width='"&100*[Business Count]&"' height='10' fill='red'/>
    <text x='"&100*[Private Count]&"' y='7' text-anchor='end' font-size='5'>"&100*ROUND([Private Count],2)&"%" &"</text>
    <text x='"&100*[Private Count]+100*[Public Count]&"' y='7' text-anchor='end' font-size='5'>"&100*ROUND([Public Count],2)&"%" &"</text>
    <text x='100' y='7' text-anchor='end' font-size='5'>"&100*ROUND([Business Count],2)&"%" &"</text>
    </svg>"

    Then add a new card:

    Next, click formatting > visual > Images

    Open the Image and select image url in image type:

    The result is as follow:

     

    Best Regards

    Zhengdong Xu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.