<?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: Python to DAX Conversion in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Python-to-DAX-Conversion/m-p/1664742#M33983</link>
    <description>&lt;P&gt;hi i only know how to write dax within power pivot, but i think you would write something like this.&lt;/P&gt;&lt;P&gt;if it doesnt work the concept is correct, might just need to tweak the syntax to suit your environment.&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;evaluate

    summarize(
                addcolumns(table,"Year",format(table[date],"yyyy"),
                [Year],
                [caseno]
              )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 13 Feb 2021 23:16:36 GMT</pubDate>
    <dc:creator>rfigtree</dc:creator>
    <dc:date>2021-02-13T23:16:36Z</dc:date>
    <item>
      <title>Python to DAX Conversion</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Python-to-DAX-Conversion/m-p/1664669#M33977</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are trying to convert the following python code into DAX. The goal is to&lt;/P&gt;&lt;DIV&gt;distinct count of case number (caseno) grouped by (year), where occ date/time (&lt;STRONG&gt;occuron&lt;/STRONG&gt;) is like YYYY&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Any help or assitance is greatly appreciated. Anything bolded is the column name in our dataset. Anything underlined denotes the table. The tables and columns would be indicated in DAX like: (e.g., '&lt;U&gt;table'&lt;/U&gt; and [&lt;STRONG&gt;column&lt;/STRONG&gt;] would come from this: '&lt;U&gt;wa offense&lt;/U&gt;'[&lt;STRONG&gt;caseno&lt;/STRONG&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;SELECT date_format(&lt;STRONG&gt;occuron&lt;/STRONG&gt;, '%Y') AS &lt;STRONG&gt;occuronyear&lt;/STRONG&gt;, count(DISTINCT &lt;STRONG&gt;caseno&lt;/STRONG&gt;) AS &lt;STRONG&gt;dis_caseno&lt;/STRONG&gt; FROM &lt;U&gt;wa offense&lt;/U&gt; GROUP BY date_format(&lt;STRONG&gt;occuron&lt;/STRONG&gt;, '%Y')&lt;/DIV&gt;&lt;DIV&gt;____________________&lt;/DIV&gt;&lt;DIV&gt;Specfic &lt;STRONG&gt;ibroff&lt;/STRONG&gt; category:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;SELECT date_format(occuron, '%Y') AS &lt;STRONG&gt;occuronyear&lt;/STRONG&gt;, count(DISTINCT &lt;STRONG&gt;caseno&lt;/STRONG&gt;) AS &lt;STRONG&gt;dis_caseno&lt;/STRONG&gt;, &lt;STRONG&gt;ibroff&lt;/STRONG&gt;&lt;BR /&gt;FROM &lt;U&gt;wa offense&lt;/U&gt;&lt;BR /&gt;GROUP BY date_format(&lt;STRONG&gt;occuron&lt;/STRONG&gt;, '%Y'), &lt;STRONG&gt;ibroff&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Alternatively, is there a way to utilize python instead of DAX? Thank you!&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 13 Feb 2021 19:13:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Python-to-DAX-Conversion/m-p/1664669#M33977</guid>
      <dc:creator>neil37</dc:creator>
      <dc:date>2021-02-13T19:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python to DAX Conversion</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Python-to-DAX-Conversion/m-p/1664742#M33983</link>
      <description>&lt;P&gt;hi i only know how to write dax within power pivot, but i think you would write something like this.&lt;/P&gt;&lt;P&gt;if it doesnt work the concept is correct, might just need to tweak the syntax to suit your environment.&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;evaluate

    summarize(
                addcolumns(table,"Year",format(table[date],"yyyy"),
                [Year],
                [caseno]
              )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Feb 2021 23:16:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Python-to-DAX-Conversion/m-p/1664742#M33983</guid>
      <dc:creator>rfigtree</dc:creator>
      <dc:date>2021-02-13T23:16:36Z</dc:date>
    </item>
  </channel>
</rss>

