<?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: help me with right DAX script / any other way to visualize in PowerBI reports in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/help-me-with-right-DAX-script-any-other-way-to-visualize-in/m-p/3553919#M136752</link>
    <description>&lt;P&gt;This DAX is not generalised and is not working for any number of criteria items say, if the Criteria[Criteria] has more than 2 criterias and if multiple selection happens.&lt;/P&gt;&lt;P&gt;Say, if&amp;nbsp;Criteria[Criteria] has 5 items called &lt;STRONG&gt;"color, size, manufactured by, marketed by, cost"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;using the same dax script given, if we chose criteria as color, size, cost , how can i adapt the script for this kind ?&lt;/P&gt;</description>
    <pubDate>Mon, 27 Nov 2023 11:00:36 GMT</pubDate>
    <dc:creator>raghuinpowerbi</dc:creator>
    <dc:date>2023-11-27T11:00:36Z</dc:date>
    <item>
      <title>help me with right DAX script / any other way to visualize in PowerBI reports</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/help-me-with-right-DAX-script-any-other-way-to-visualize-in/m-p/3500041#M134191</link>
      <description>&lt;P&gt;In my powerbi reports, i would like to visualize the table of similar products based on the selection of one particular product.&lt;/P&gt;&lt;P&gt;Similarity decisions should be taken based on the columns/criteria chosen.&lt;/P&gt;&lt;P&gt;Say example, below is the products table.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CriteriaFields table is the list of column names of Product table, usually.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Visual report, it is like below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i choose product C and in criteria fields Color, it should list other similar products which is same color as of Product C.&lt;/P&gt;&lt;P&gt;if i choose product C and in criteria fields Color &amp;amp; Size, it should list other similar products which is of same color and size as of Product C.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please suggest me a better way to do it ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 22:16:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/help-me-with-right-DAX-script-any-other-way-to-visualize-in/m-p/3500041#M134191</guid>
      <dc:creator>raghuinpowerbi</dc:creator>
      <dc:date>2023-10-26T22:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: help me with right DAX script / any other way to visualize in PowerBI reports</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/help-me-with-right-DAX-script-any-other-way-to-visualize-in/m-p/3500390#M134205</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file if it suits your requirement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Color measure: = 
IF (
    HASONEVALUE ( Data[Product] ),
    VAR _productselectlist =
        VALUES ( 'Product'[Product] )
    VAR _colorselectlist =
        SUMMARIZE (
            FILTER ( ALL ( Data ), Data[Product] IN _productselectlist ),
            Data[Color]
        )
    VAR _sizeselectlist =
        SUMMARIZE (
            FILTER ( ALL ( Data ), Data[Product] IN _productselectlist ),
            Data[Size]
        )
    RETURN
        SWITCH (
            TRUE (),
            SELECTEDVALUE ( Criteria[Criteria] ) = "Color", MAXX ( FILTER ( Data, Data[Color] IN _colorselectlist ), Data[Color] ),
            SELECTEDVALUE ( Criteria[Criteria] ) = "Size", MAXX ( FILTER ( Data, Data[Size] IN _sizeselectlist ), Data[Color] ),
            MAXX (
                FILTER (
                    Data,
                    Data[Color]
                        IN _colorselectlist
                            &amp;amp;&amp;amp; Data[Size] IN _sizeselectlist
                ),
                Data[Color]
            )
        )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Size measure: = 
IF (
    HASONEVALUE ( Data[Product] ),
    VAR _productselectlist =
        VALUES ( 'Product'[Product] )
    VAR _colorselectlist =
        SUMMARIZE (
            FILTER ( ALL ( Data ), Data[Product] IN _productselectlist ),
            Data[Color]
        )
    VAR _sizeselectlist =
        SUMMARIZE (
            FILTER ( ALL ( Data ), Data[Product] IN _productselectlist ),
            Data[Size]
        )
    RETURN
        SWITCH (
            TRUE (),
            SELECTEDVALUE ( Criteria[Criteria] ) = "Color", MAXX ( FILTER ( Data, Data[Color] IN _colorselectlist ), Data[Size] ),
            SELECTEDVALUE ( Criteria[Criteria] ) = "Size", MAXX ( FILTER ( Data, Data[Size] IN _sizeselectlist ), Data[Size] ),
            MAXX (
                FILTER (
                    Data,
                    Data[Color]
                        IN _colorselectlist
                            &amp;amp;&amp;amp; Data[Size] IN _sizeselectlist
                ),
                Data[Size]
            )
        )
)&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;</description>
      <pubDate>Fri, 27 Oct 2023 03:31:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/help-me-with-right-DAX-script-any-other-way-to-visualize-in/m-p/3500390#M134205</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-10-27T03:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: help me with right DAX script / any other way to visualize in PowerBI reports</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/help-me-with-right-DAX-script-any-other-way-to-visualize-in/m-p/3501142#M134248</link>
      <description>&lt;P&gt;thats quick and perfect. thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 11:05:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/help-me-with-right-DAX-script-any-other-way-to-visualize-in/m-p/3501142#M134248</guid>
      <dc:creator>raghuinpowerbi</dc:creator>
      <dc:date>2023-10-27T11:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: help me with right DAX script / any other way to visualize in PowerBI reports</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/help-me-with-right-DAX-script-any-other-way-to-visualize-in/m-p/3553919#M136752</link>
      <description>&lt;P&gt;This DAX is not generalised and is not working for any number of criteria items say, if the Criteria[Criteria] has more than 2 criterias and if multiple selection happens.&lt;/P&gt;&lt;P&gt;Say, if&amp;nbsp;Criteria[Criteria] has 5 items called &lt;STRONG&gt;"color, size, manufactured by, marketed by, cost"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;using the same dax script given, if we chose criteria as color, size, cost , how can i adapt the script for this kind ?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 11:00:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/help-me-with-right-DAX-script-any-other-way-to-visualize-in/m-p/3553919#M136752</guid>
      <dc:creator>raghuinpowerbi</dc:creator>
      <dc:date>2023-11-27T11:00:36Z</dc:date>
    </item>
  </channel>
</rss>

