<?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: How to filter content of one column in the context of combination of other columns including date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-content-of-one-column-in-the-context-of/m-p/2847105#M91137</link>
    <description>&lt;P&gt;&lt;SPAN&gt;This doesn't work. My problem statement is complex than what you have interpreted and replied.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Oct 2022 16:20:00 GMT</pubDate>
    <dc:creator>NV89</dc:creator>
    <dc:date>2022-10-17T16:20:00Z</dc:date>
    <item>
      <title>How to filter content of one column in the context of combination of other columns including date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-content-of-one-column-in-the-context-of/m-p/2843458#M90899</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am very new to PowerBI and this is 1st time I am posting a question so, please pardon if something is incorrect. Here is my problem statement.&lt;/P&gt;&lt;P&gt;I have following table with date (random), Store, Person, Product &amp;amp; Sales columns. I want to create a measure which works in context of Date, Store &amp;amp; Person in combine and generates a resulting Output column as shown below. Output column is based on the filter of Product column based on another Table which contains list of products to use for filter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table to filter:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#CC99FF"&gt;Cereal&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#CC99FF"&gt;Tissues&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#CC99FF"&gt;Detergents&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input Table (with Output column as expected resulting column)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Store&lt;/TD&gt;&lt;TD&gt;Person&lt;/TD&gt;&lt;TD&gt;Product&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;Output&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;1/1/2022&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;Store1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;Mike&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#CC99FF"&gt;Cereal&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;&amp;lt;- Since Mike from Store1 sold an item from a given table (i.e. Cereal), output is equal to Sales column for that product&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;1/1/2022&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;Store1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;Mike&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;Cheeses&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;1/1/2022&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;Store1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;Mike&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;Crackers&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#0000FF"&gt;1/1/2022&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#0000FF"&gt;Store1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#0000FF"&gt;John&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#CC99FF"&gt;Tissues&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;&amp;lt;- Since John from Store1 sold an item from a given table (i.e. Tissues), output is equal to Sales column for that product&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#0000FF"&gt;1/1/2022&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#0000FF"&gt;Store1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#0000FF"&gt;John&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;Cheeses&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#008080"&gt;1/1/2022&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#008080"&gt;Store2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#008080"&gt;Rod&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;Juices&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;&amp;lt;- Since Rod from Store2 didn't sell any items from a given table and we don't have any records of him selling any item from a given table from any previous dates, resulting output is 0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;1/5/2022&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;Store1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;Mike&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;Juices&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;&amp;lt;- Since Mike from Store1 didn't sell any item from a given table, carry forward the sales of an item that he sold from a table on previous date i.e. he sold 10 Cereal on 1/1/2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;1/8/2022&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;Store1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;Mike&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#CC99FF"&gt;Detergents&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;&amp;lt;- Since Mike from Store1 sold one of the item from a given table, the resulting output is 20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#FF00FF"&gt;1/8/2022&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF00FF"&gt;Store2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF00FF"&gt;John&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;Towels&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;&amp;lt;- Here, John is a different person who works in Store2 and since he didn't sell any item from a given table on current date or any of the previous dates, resulting output is 0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sat, 15 Oct 2022 02:20:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-content-of-one-column-in-the-context-of/m-p/2843458#M90899</guid>
      <dc:creator>NV89</dc:creator>
      <dc:date>2022-10-15T02:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter content of one column in the context of combination of other columns including date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-content-of-one-column-in-the-context-of/m-p/2843511#M90902</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just create a measure&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Output = SUM('Input Table'[Sales])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and connect your Product table (1:n) to your Input Table (field Product). Add a slicer from the product table and voilá &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(You should also create a seperate date table and connect the date field to the date field of the Input table to be able to use time intelligence functions)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2022 04:30:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-content-of-one-column-in-the-context-of/m-p/2843511#M90902</guid>
      <dc:creator>lukiz84</dc:creator>
      <dc:date>2022-10-15T04:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter content of one column in the context of combination of other columns including date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-content-of-one-column-in-the-context-of/m-p/2847105#M91137</link>
      <description>&lt;P&gt;&lt;SPAN&gt;This doesn't work. My problem statement is complex than what you have interpreted and replied.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 16:20:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-content-of-one-column-in-the-context-of/m-p/2847105#M91137</guid>
      <dc:creator>NV89</dc:creator>
      <dc:date>2022-10-17T16:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter content of one column in the context of combination of other columns including date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-content-of-one-column-in-the-context-of/m-p/2847975#M91183</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="456966" data-lia-user-login="NV89" class="lia-mention lia-mention-user"&gt;NV89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can try the following methods.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Column:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
IF([Product] in VALUES('Filter'[Filter]),[Sales])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Output = 
Var _lastdate=
CALCULATE(MIN('Table'[Date]),FILTER('Table',[Person]=EARLIER('Table'[Person])&amp;amp;&amp;amp;[Column]&amp;lt;&amp;gt;BLANK()))
Var _InFliter=
CALCULATE(MAX('Table'[Column]),FILTER('Table',[Person]=EARLIER('Table'[Person])&amp;amp;&amp;amp;[Date]=EARLIER('Table'[Date])))
Var _lastsales=
CALCULATE(MAX('Table'[Sales]),FILTER('Table',[Date]=_lastdate
                               &amp;amp;&amp;amp;[Person]=EARLIER('Table'[Person])&amp;amp;&amp;amp;[Product] in VALUES('Filter'[Filter])))
return
IF(_InFliter=BLANK(),0,IF([Column]&amp;lt;&amp;gt;BLANK(),[Column],IF([Date]&amp;lt;&amp;gt;_lastdate,_lastsales)))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Is this the result you expect?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 03:19:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-filter-content-of-one-column-in-the-context-of/m-p/2847975#M91183</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2022-10-18T03:19:12Z</dc:date>
    </item>
  </channel>
</rss>

