<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Custom Matrix in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3481150#M8108</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've updated the .pbix file so maybe it is more clear&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://we.tl/t-H4m8bvxzST?utm_campaign=TRN_TDL_05&amp;amp;utm_source=sendgrid&amp;amp;utm_medium=email&amp;amp;trk=TRN_TDL_05" target="_self"&gt;matrix with images&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Images area completely random)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 17 Oct 2023 13:26:08 GMT</pubDate>
    <dc:creator>Br1-981</dc:creator>
    <dc:date>2023-10-17T13:26:08Z</dc:date>
    <item>
      <title>Custom Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3473627#M8071</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would build a matrix like this including 2 measures (assume costs and % of each class at category level).&lt;/P&gt;&lt;P&gt;Is there any way to build something like this?&lt;/P&gt;&lt;P&gt;Consider that categories are dynamic while classes are static:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Br1981_0-1697118031459.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/980306i7B7CC6B5424BE65E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Br1981_0-1697118031459.png" alt="Br1981_0-1697118031459.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;At the moment I have no idea about how to develop this, problably deneb could be a way...&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 13:43:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3473627#M8071</guid>
      <dc:creator>Br1-981</dc:creator>
      <dc:date>2023-10-12T13:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3476129#M8077</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/504843"&gt;@Br1-981&lt;/a&gt;.&amp;nbsp;Do you mind providing a sanitized example dataset (&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;here's how&lt;/A&gt;) that matches the column names that you're wanting to use in your implementation? I'd be happy to try and help.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 17:44:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3476129#M8077</guid>
      <dc:creator>giammariam</dc:creator>
      <dc:date>2023-10-13T17:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3478367#M8094</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;here you got a .pbix file made using a sample dataset from PBI&lt;/P&gt;&lt;P&gt;&lt;A href="https://wetransfer.com/downloads/f1a69c7cf0e6b393d72ec5c05eb1510b20231016091548/c80aafd31320726f17db3637b6a3ce2320231016091610/0fe6a4?trk=TRN_TDL_01&amp;amp;utm_campaign=TRN_TDL_01&amp;amp;utm_medium=email&amp;amp;utm_source=sendgrid" target="_self"&gt;Pbix file&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your support!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 09:18:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3478367#M8094</guid>
      <dc:creator>Br1-981</dc:creator>
      <dc:date>2023-10-16T09:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3479009#M8096</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/504843"&gt;@Br1-981&lt;/a&gt;, thanks for the .pbix. I created 2 measures:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;_Shares = 
VAR _selectedSumOfSales = SUMX(
    Sheet1,
    Sheet1[ Sales]
)
VAR _selectedProduct = SELECTEDVALUE(Sheet1[Product])
VAR _totalSalesPerSegment = SUMX(
    FILTER(
        ALLSELECTED(Sheet1),
        Sheet1[Product] = _selectedProduct
    ),
    Sheet1[ Sales]
)
RETURN DIVIDE(_selectedSumOfSales, _totalSalesPerSegment)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;_Sales&amp;amp;SharesFormatted = 
VAR _lineBreak = UNICHAR(10)
VAR _sales = SUMX(
    Sheet1,
    Sheet1[ Sales]
)

/*** 
Dynamic number formatting. Found here:
https://community.fabric.microsoft.com/t5/Custom-Visuals-Ideas/Auto-Format-Numbers-in-Billions-Millions-Thousands-etc/idi-p/1439322
***/
VAR _safeLog =
    IFERROR ( ABS(INT ( LOG ( ABS ( _sales), 1000 ) )), 0 )
VAR dp = 1

VAR _salesFormatted = ROUND ( DIVIDE ( _sales, 1000 ^ _safeLog ), dp )
        &amp;amp; SWITCH ( _safelog, 1, "K", 2, "M", 3, "B", 4, "T" )
/***/

VAR _sharesFormatted = FORMAT([_Shares], "0.00%")

RETURN _salesFormatted&amp;amp;_lineBreak&amp;amp;_sharesFormatted&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I then placed [_Sales&amp;amp;SharesFormatted] as the only field in the&amp;nbsp;&lt;EM&gt;Values&lt;/EM&gt; well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="giammariam_0-1697463848774.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/981681i75A49A9A4EF619BB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="giammariam_0-1697463848774.png" alt="giammariam_0-1697463848774.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You will want to play with the formatting in the [_Sales&amp;amp;SharesFormatted] measure.&lt;BR /&gt;&lt;BR /&gt;If you need the sales in bold, this can be down using dynamic SVGs. I can help with this if needed. Otherwise, if this is enough to get you going please consider liking this reply and choosing it as the solution. Otherwise, I'm happy to help further.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 13:49:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3479009#M8096</guid>
      <dc:creator>giammariam</dc:creator>
      <dc:date>2023-10-16T13:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3479026#M8097</link>
      <description>&lt;P&gt;thanks a lot, I'll test asap and let you know about it!&lt;/P&gt;&lt;P&gt;In this scenario, do you think it is possible to format (font size and colour) the 2 values as showed in my example?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 13:49:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3479026#M8097</guid>
      <dc:creator>Br1-981</dc:creator>
      <dc:date>2023-10-16T13:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3479129#M8099</link>
      <description>&lt;P&gt;thanks a lot, I'll test asap and let you know about it!&lt;/P&gt;&lt;P&gt;In this scenario, do you think it is possible to format (font size and colour) the 2 values as showed in my example?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 14:33:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3479129#M8099</guid>
      <dc:creator>Br1-981</dc:creator>
      <dc:date>2023-10-16T14:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3479290#M8100</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/504843"&gt;@Br1-981&lt;/a&gt;,&amp;nbsp;here's what's involved with the dynamic SVG approach for formatting:&lt;BR /&gt;&lt;BR /&gt;Measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;_Sales = 
VAR _sales = SUMX(
    Sheet1,
    Sheet1[ Sales]
)

RETURN _sales&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;_Shares = 
VAR _selectedSumOfSales = [_Sales]
VAR _selectedProduct = SELECTEDVALUE(Sheet1[Product])
VAR _totalSalesPerSegment = SUMX(
    FILTER(
        ALLSELECTED(Sheet1),
        Sheet1[Product] = _selectedProduct
    ),
    Sheet1[ Sales]
)
RETURN DIVIDE(_selectedSumOfSales, _totalSalesPerSegment)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;_SVG_Sales_&amp;amp;_Shares = 
VAR _imageWidth = 80
VAR _imageHeight = 40
VAR _fontSize = 12
VAR _backgroundHex = "#f2f2f2"
VAR _salesHex = "#023261"

VAR _sales = [_Sales]

/*** 
Dynamic number formatting. Found here:
https://community.fabric.microsoft.com/t5/Custom-Visuals-Ideas/Auto-Format-Numbers-in-Billions-Millions-Thousands-etc/idi-p/1439322
***/
VAR _safeLog =
    IFERROR ( ABS(INT ( LOG ( ABS ( _sales), 1000 ) )), 0 )
VAR dp = 1

VAR _salesFormatted = ROUND ( DIVIDE ( _sales, 1000 ^ _safeLog ), dp )
        &amp;amp; SWITCH ( _safelog, 1, "K", 2, "M", 3, "B", 4, "T" )
/***/

VAR _sharesFormatted = FORMAT([_Shares], "0.00%")

VAR _prefix = "data&amp;amp;colon;image/svg+xml;utf8,"
VAR _svg = "
&amp;lt;svg viewBox='0 0 "&amp;amp; _imageWidth &amp;amp;" "&amp;amp; _imageHeight &amp;amp;"' xmlns='http://www.w3.org/2000/svg'&amp;gt;
  &amp;lt;rect fill='"&amp;amp;_backgroundHex&amp;amp;"' width='"&amp;amp;_imageWidth&amp;amp;"' height='"&amp;amp;_imageHeight&amp;amp;"'&amp;gt;&amp;lt;/rect&amp;gt;
  &amp;lt;text style='fill: "&amp;amp;_salesHex&amp;amp;"; font-family: Segoe UI; font-size: "&amp;amp;_fontSize&amp;amp;"px; font-weight: 700; white-space: pre; text-anchor: middle; transform-origin: 4.5px 12.957px;' x='"&amp;amp; _imageWidth/2 &amp;amp;"' y='14'&amp;gt;"&amp;amp;COALESCE(_salesFormatted, "")&amp;amp;"&amp;lt;/text&amp;gt;
  &amp;lt;text style='fill: "&amp;amp;_salesHex&amp;amp;"; font-family:  Segoe UI; font-size: "&amp;amp;_fontSize&amp;amp;"px; white-space: pre; text-anchor: middle;' x='"&amp;amp; _imageWidth/2 &amp;amp;"' y='30'&amp;gt;"&amp;amp;COALESCE(_sharesFormatted, "")&amp;amp;"&amp;lt;/text&amp;gt;
&amp;lt;/svg&amp;gt;
"

RETURN _prefix&amp;amp;_svg&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Set the&amp;nbsp;&lt;EM&gt;Image size &lt;/EM&gt;desired&amp;nbsp;dimensions&amp;nbsp;under the formatting properties. What ever values you use, you'll want to update the &lt;EM&gt;_imageWidth&lt;/EM&gt; and &lt;EM&gt;imageHeight&lt;/EM&gt; variables in the [_SVG_Sales_&amp;amp;_Shares] measure.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="giammariam_0-1697470870088.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/981750i82DDDC903C14E0BE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="giammariam_0-1697470870088.png" alt="giammariam_0-1697470870088.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[_SVG_Sales_&amp;amp;_Shares] is the measure to use in the Values well for the matrix.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here is the result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="giammariam_1-1697470969657.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/981755i486CD630F3A37BC7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="giammariam_1-1697470969657.png" alt="giammariam_1-1697470969657.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 16:14:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3479290#M8100</guid>
      <dc:creator>giammariam</dc:creator>
      <dc:date>2023-10-16T16:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3480687#M8106</link>
      <description>&lt;P&gt;thanks a lot, it is amazing!&lt;/P&gt;&lt;P&gt;Just one thing, while lookign for an alternative I built the matrix in this way:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Br1981_0-1697531404611.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/982074iE420173E6553C33A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Br1981_0-1697531404611.png" alt="Br1981_0-1697531404611.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;putting on rows and colums images that are in dedicated dimensions (IMAGE_URL):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Br1981_1-1697531507966.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/982075i363214CD56BD0E91/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Br1981_1-1697531507966.png" alt="Br1981_1-1697531507966.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Using your measurements did not work, should I reference the calculated measures to the IMAGE_URL instead of native dimensions (product and segment) or am I asking too much? &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 08:53:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3480687#M8106</guid>
      <dc:creator>Br1-981</dc:creator>
      <dc:date>2023-10-17T08:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3480980#M8107</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/504843"&gt;@Br1-981&lt;/a&gt;,&amp;nbsp;I'm not understanding what you're trying to achieve with the updated design, so it is difficult for me to identify how the measures I created for you would need to be updated. Could you help me understand what you'd like the new matrix to look like? Maybe a picture of the desired outcome would help. If you have an updated .pbix file, that'd help as well. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 11:40:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3480980#M8107</guid>
      <dc:creator>giammariam</dc:creator>
      <dc:date>2023-10-17T11:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3481150#M8108</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've updated the .pbix file so maybe it is more clear&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://we.tl/t-H4m8bvxzST?utm_campaign=TRN_TDL_05&amp;amp;utm_source=sendgrid&amp;amp;utm_medium=email&amp;amp;trk=TRN_TDL_05" target="_self"&gt;matrix with images&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Images area completely random)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 13:26:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-Matrix/m-p/3481150#M8108</guid>
      <dc:creator>Br1-981</dc:creator>
      <dc:date>2023-10-17T13:26:08Z</dc:date>
    </item>
  </channel>
</rss>

