<?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 Power Query Across Table calculated column in Quick Measures Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Power-Query-Across-Table-calculated-column/m-p/2926509#M928</link>
    <description>&lt;H1&gt;Power Query Across Table calculated column&lt;/H1&gt;
&lt;FIGURE&gt;&lt;img /&gt;&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/FIGURE&gt;
&lt;P&gt;Problem Statement: Table 1 has date ranges and table 2 has dates. We need to add a new column in table 2 which provides us with the count of rows that contains this date in table 1. In case of a null value consider today's date. This solution is needed in Power query&lt;/P&gt;
&lt;P&gt;Table1: Ranges&lt;/P&gt;
&lt;FIGURE&gt;&lt;img /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/FIGURE&gt;
&lt;P&gt;Table2: Dates&lt;/P&gt;
&lt;FIGURE&gt;&lt;img /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/FIGURE&gt;
&lt;P&gt;Solution: We add a new column in Dates. This will use Table.SelectRows to filter the data. If statement and Date.FixedLocalNow to handle the null value of date2. and Table.RowCount to count rows&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The new column formula is&lt;/P&gt;
&lt;PRE spellcheck="false" data-code-block-mode="1" data-code-block-lang="csharp"&gt;let &lt;BR /&gt;_col = [Dates],&lt;BR /&gt;_table = Table.SelectRows(Ranges, each [Date1] &amp;lt;= _col and ( if [Date2] = null then DateTime.Date( DateTime.FixedLocalNow() ) else [Date2]) &amp;gt;= _col ),&lt;BR /&gt;_count = Table.RowCount(_table)&lt;BR /&gt;in &lt;BR /&gt;_count&lt;/PRE&gt;
&lt;P&gt;This how the data look like, in Dates Table&lt;/P&gt;
&lt;FIGURE&gt;&lt;img /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/FIGURE&gt;
&lt;P&gt;You can find the blog &lt;A href="https://amitchandak.medium.com/power-query-across-table-calculated-column-718809a97fd" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The file is attached after signature&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;Find all my Medium blogs&amp;nbsp;&lt;A href="https://amitchandak.medium.com/" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;Click&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Data-Stories-Gallery/Blog-Analysis/m-p/1265567#M4403" target="_blank" rel="noopener ugc nofollow"&gt;Here&lt;/A&gt;&amp;nbsp;to access all my blogs and videos in a jiffy via an exclusive visual glossary using Power BI.&lt;BR /&gt;Please like, share, and comment on these. Your suggestions on improvement, challenges, and new topics will help me explore more.&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;You Can watch my Power BI Tutorial Series on&amp;nbsp;&lt;A href="https://www.youtube.com/c/Amitchandak?sub_confirmation=1" target="_blank" rel="noopener ugc nofollow"&gt;My Channel&lt;/A&gt;, Subscribe, Like, and share&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;&lt;A href="https://www.youtube.com/watch?v=wvsAzTqSDVg&amp;amp;list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb" target="_blank" rel="noopener ugc nofollow"&gt;Master Power BI&lt;/A&gt;&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;&lt;A href="https://www.youtube.com/watch?v=59PUFuuCrbY&amp;amp;list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L" target="_blank" rel="noopener ugc nofollow"&gt;Expertise Power BI&lt;/A&gt;&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;&lt;A href="https://www.youtube.com/watch?v=tAmg00Wf_cw&amp;amp;list=PLPaNVDMhUXGYzjFASXjdY7GNoFxvlkR54" target="_blank" rel="noopener ugc nofollow"&gt;Power BI For Tableau User&lt;/A&gt;&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;&lt;A href="https://www.youtube.com/watch?v=WlvQ_SGy4iA&amp;amp;list=PLPaNVDMhUXGZNyKU0PgG2g3P0c6CPjMnj" target="_blank" rel="noopener ugc nofollow"&gt;DAX for SQL Users&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Nov 2022 08:59:44 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-11-24T08:59:44Z</dc:date>
    <item>
      <title>Power Query Across Table calculated column</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Power-Query-Across-Table-calculated-column/m-p/2926509#M928</link>
      <description>&lt;H1&gt;Power Query Across Table calculated column&lt;/H1&gt;
&lt;FIGURE&gt;&lt;img /&gt;&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/FIGURE&gt;
&lt;P&gt;Problem Statement: Table 1 has date ranges and table 2 has dates. We need to add a new column in table 2 which provides us with the count of rows that contains this date in table 1. In case of a null value consider today's date. This solution is needed in Power query&lt;/P&gt;
&lt;P&gt;Table1: Ranges&lt;/P&gt;
&lt;FIGURE&gt;&lt;img /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/FIGURE&gt;
&lt;P&gt;Table2: Dates&lt;/P&gt;
&lt;FIGURE&gt;&lt;img /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/FIGURE&gt;
&lt;P&gt;Solution: We add a new column in Dates. This will use Table.SelectRows to filter the data. If statement and Date.FixedLocalNow to handle the null value of date2. and Table.RowCount to count rows&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The new column formula is&lt;/P&gt;
&lt;PRE spellcheck="false" data-code-block-mode="1" data-code-block-lang="csharp"&gt;let &lt;BR /&gt;_col = [Dates],&lt;BR /&gt;_table = Table.SelectRows(Ranges, each [Date1] &amp;lt;= _col and ( if [Date2] = null then DateTime.Date( DateTime.FixedLocalNow() ) else [Date2]) &amp;gt;= _col ),&lt;BR /&gt;_count = Table.RowCount(_table)&lt;BR /&gt;in &lt;BR /&gt;_count&lt;/PRE&gt;
&lt;P&gt;This how the data look like, in Dates Table&lt;/P&gt;
&lt;FIGURE&gt;&lt;img /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/FIGURE&gt;
&lt;P&gt;You can find the blog &lt;A href="https://amitchandak.medium.com/power-query-across-table-calculated-column-718809a97fd" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The file is attached after signature&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;Find all my Medium blogs&amp;nbsp;&lt;A href="https://amitchandak.medium.com/" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;Click&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Data-Stories-Gallery/Blog-Analysis/m-p/1265567#M4403" target="_blank" rel="noopener ugc nofollow"&gt;Here&lt;/A&gt;&amp;nbsp;to access all my blogs and videos in a jiffy via an exclusive visual glossary using Power BI.&lt;BR /&gt;Please like, share, and comment on these. Your suggestions on improvement, challenges, and new topics will help me explore more.&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;You Can watch my Power BI Tutorial Series on&amp;nbsp;&lt;A href="https://www.youtube.com/c/Amitchandak?sub_confirmation=1" target="_blank" rel="noopener ugc nofollow"&gt;My Channel&lt;/A&gt;, Subscribe, Like, and share&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;&lt;A href="https://www.youtube.com/watch?v=wvsAzTqSDVg&amp;amp;list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb" target="_blank" rel="noopener ugc nofollow"&gt;Master Power BI&lt;/A&gt;&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;&lt;A href="https://www.youtube.com/watch?v=59PUFuuCrbY&amp;amp;list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L" target="_blank" rel="noopener ugc nofollow"&gt;Expertise Power BI&lt;/A&gt;&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;&lt;A href="https://www.youtube.com/watch?v=tAmg00Wf_cw&amp;amp;list=PLPaNVDMhUXGYzjFASXjdY7GNoFxvlkR54" target="_blank" rel="noopener ugc nofollow"&gt;Power BI For Tableau User&lt;/A&gt;&lt;/P&gt;
&lt;P data-selectable-paragraph=""&gt;&lt;A href="https://www.youtube.com/watch?v=WlvQ_SGy4iA&amp;amp;list=PLPaNVDMhUXGZNyKU0PgG2g3P0c6CPjMnj" target="_blank" rel="noopener ugc nofollow"&gt;DAX for SQL Users&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 08:59:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Power-Query-Across-Table-calculated-column/m-p/2926509#M928</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-11-24T08:59:44Z</dc:date>
    </item>
  </channel>
</rss>

