<?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: Question on Relate and RelatedTable function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-on-Relate-and-RelatedTable-function/m-p/2138898#M49151</link>
    <description>&lt;P&gt;I am referring to the column Selected Product Category (Concatenatex, Ass, Improved). I would like to empty all the store_id rows across the&amp;nbsp;Selected Product Category column.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am thinking that I need to add an expression on the IF(HasOneValue).&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 17 Oct 2021 14:10:59 GMT</pubDate>
    <dc:creator>alvin199</dc:creator>
    <dc:date>2021-10-17T14:10:59Z</dc:date>
    <item>
      <title>Question on Relate and RelatedTable function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-on-Relate-and-RelatedTable-function/m-p/2138798#M49143</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know why I do not need to use RELATE OR RELATEDTABLE function on&amp;nbsp;&lt;SPAN&gt;'Sales by Store'[Total Revenue]&amp;nbsp; or&amp;nbsp;'Sales by Store', respectively, but use either one only as I am using&amp;nbsp;Store Lookup in the whole DAX?&amp;nbsp;There are relationship between Sales by Store table and Product Lookup table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Selected Product Category&amp;nbsp; = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;HASONEVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Store Lookup'[store_id]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CONCATENATEX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Product Lookup'[product_category]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Product Lookup'[product_category]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;": "&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales by Store'[Total Revenue]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;-- 'Product Lookup'[product_category],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;", "&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Product Lookup'[product_category]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ASC&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;""&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 17 Oct 2021 11:59:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-on-Relate-and-RelatedTable-function/m-p/2138798#M49143</guid>
      <dc:creator>alvin199</dc:creator>
      <dc:date>2021-10-17T11:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Question on Relate and RelatedTable function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-on-Relate-and-RelatedTable-function/m-p/2138805#M49144</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="311209" data-lia-user-login="alvin199" class="lia-mention lia-mention-user"&gt;alvin199&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I believe the Total Revenue is a Column. Try the following modified formula. You need to use CALCULATE to activate the relationship between the tables.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Selected Product Category =
IF (
    HASONEVALUE ( 'Store Lookup'[store_id] ),
    CONCATENATEX (
        VALUES ( 'Product Lookup'[product_category] ),
        'Product Lookup'[product_category] &amp;amp; ": "
            &amp;amp; CALCULATE ( SUM ( 'Sales by Store'[Total Revenue] ) ),
        -- 'Product Lookup'[product_category],
        ", ",
        'Product Lookup'[product_category], ASC
    ),
    ""
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Oct 2021 12:10:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-on-Relate-and-RelatedTable-function/m-p/2138805#M49144</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2021-10-17T12:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Question on Relate and RelatedTable function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-on-Relate-and-RelatedTable-function/m-p/2138822#M49146</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="52518" data-lia-user-login="Fowmy" class="lia-mention lia-mention-user"&gt;Fowmy&lt;/a&gt;&amp;nbsp;, thanks for reply.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Yes,&amp;nbsp;&lt;SPAN&gt;Total Revenue is a Column in Sales by Store table.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The DAX works fine. I still do not understand why we do not need to use RELATE or RELATEDTABLE in here even both the table has active relationship.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Besides,&amp;nbsp; when I use it to as a filter context for store_id and store_city (from Store Lookup table), it display the total similar to 2 rows together (store_id and store_city) for each type of the product category.&lt;BR /&gt;How can I empty the store_id row and only the store_city has the value for each product category?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Oct 2021 12:50:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-on-Relate-and-RelatedTable-function/m-p/2138822#M49146</guid>
      <dc:creator>alvin199</dc:creator>
      <dc:date>2021-10-17T12:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Question on Relate and RelatedTable function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-on-Relate-and-RelatedTable-function/m-p/2138844#M49148</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="311209" data-lia-user-login="alvin199" class="lia-mention lia-mention-user"&gt;alvin199&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can use the RELATEDTABLE function when you the Dimension level and need to fetch data from the FAct table, as it returns a table you need to do the calculation.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To get rid of the two-line in the matrix, get rid of the Steped Layout:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Oct 2021 13:18:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-on-Relate-and-RelatedTable-function/m-p/2138844#M49148</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2021-10-17T13:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Question on Relate and RelatedTable function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-on-Relate-and-RelatedTable-function/m-p/2138898#M49151</link>
      <description>&lt;P&gt;I am referring to the column Selected Product Category (Concatenatex, Ass, Improved). I would like to empty all the store_id rows across the&amp;nbsp;Selected Product Category column.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am thinking that I need to add an expression on the IF(HasOneValue).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Oct 2021 14:10:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-on-Relate-and-RelatedTable-function/m-p/2138898#M49151</guid>
      <dc:creator>alvin199</dc:creator>
      <dc:date>2021-10-17T14:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Question on Relate and RelatedTable function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-on-Relate-and-RelatedTable-function/m-p/2144775#M49344</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="311209" data-lia-user-login="alvin199" class="lia-mention lia-mention-user"&gt;alvin199&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;In this case, you can try to use Hasonefilter instead of Hasonevalue for the column in your picture:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = HASONEFILTER('Table'[City])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can refer the difference between Hasonevalue and Hasonefilter:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sumproduct.com/blog/article/power-pivot-principles/ppp-hasonefilter-vs-hasonevalue-vs-isfiltered" target="_self"&gt;HASONEFILTER vs. HASONEVALUE vs. ISFILTERED&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Yingjie Li&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 06:11:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-on-Relate-and-RelatedTable-function/m-p/2144775#M49344</guid>
      <dc:creator>v-yingjl</dc:creator>
      <dc:date>2021-10-20T06:11:20Z</dc:date>
    </item>
  </channel>
</rss>

