<?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: Filter data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-data/m-p/3412708#M129034</link>
    <description>&lt;P&gt;The MDX query you provided is selecting two calculated members, UN and Lib, which represent the unique name and the name of the current year member from the [Date Creation].[Année] hierarchy. Then, it's filtering the years to only include those after 2016 and where either of the measures [Measures].[Nombre de h] or [Measures].[Nombre de V] are not empty.&lt;/P&gt;
&lt;P&gt;To migrate this to DAX in Power BI, you'd do something like the following:&lt;/P&gt;
&lt;P&gt;First, you'd need to ensure that your SSAS Tabular model has the equivalent tables and columns that represent the [Date Creation].[Année] hierarchy and the two measures.&lt;/P&gt;
&lt;P&gt;Once you've confirmed that, you can start building your DAX query. You'd likely use the FILTER and CALCULATE functions to achieve the same result.&lt;/P&gt;
&lt;P&gt;Here's a rough translation of your MDX query to DAX:&lt;/P&gt;
&lt;P&gt;EVALUATE&lt;BR /&gt;VAR CurrentYear = YEAR(TODAY())&lt;/P&gt;
&lt;P&gt;RETURN&lt;BR /&gt;FILTER(&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;VALUES('Date Creation'[Année]),&lt;BR /&gt;"UN", 'Date Creation'[Année],&lt;BR /&gt;"Lib", 'Date Creation'[Année]&lt;BR /&gt;),&lt;BR /&gt;'Date Creation'[Année] &amp;gt; 2016 &lt;BR /&gt;&amp;amp;&amp;amp; (NOT(ISBLANK([Nombre de h])) || NOT(ISBLANK([Nombre de V])))&lt;BR /&gt;)&lt;BR /&gt;This DAX query starts by evaluating the current year. It then filters the [Année] column from the Date Creation table to only include years after 2016 and where either of the measures [Nombre de h] or [Nombre de V] are not blank. The ADDCOLUMNS function is used to add the UN and Lib columns to the result.&lt;/P&gt;
&lt;P&gt;You'd then use this DAX query in Power BI to create a table or visual that represents the same data as your original SSRS report. Remember, the exact names of tables, columns, and measures in your SSAS Tabular model might differ from my example, so you'd need to adjust the DAX query accordingly.&lt;/P&gt;</description>
    <pubDate>Sun, 03 Sep 2023 17:28:05 GMT</pubDate>
    <dc:creator>technolog</dc:creator>
    <dc:date>2023-09-03T17:28:05Z</dc:date>
    <item>
      <title>Filter data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-data/m-p/1024720#M13311</link>
      <description>&lt;P&gt;I have to migrate report from SSRS to Power BI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The report SSRS based on multidimensionnal cube. The report PowerBI based on SSAS Tabular. I use direct query when connecting to SSAS tabular.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset on SSRS that I need to migrate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="5"&gt;member UN &lt;FONT face="Consolas" size="5" color="#0000ff"&gt;as&lt;FONT face="Consolas" size="5"&gt; [Date Creation]&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;[Année]&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;currentmember&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;uniquename&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5"&gt;member Lib &lt;FONT face="Consolas" size="5" color="#0000ff"&gt;as&lt;FONT face="Consolas" size="5"&gt; [Date Creation]&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;[Année]&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;currentmember&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;name&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;select&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;{&lt;FONT face="Consolas" size="5"&gt;UN&lt;FONT face="Consolas" size="5" color="#808080"&gt;,&lt;FONT face="Consolas" size="5"&gt; Lib&lt;FONT face="Consolas" size="5" color="#808080"&gt;} &lt;FONT face="Consolas" size="5" color="#0000ff"&gt;on&lt;FONT face="Consolas" size="5"&gt; 0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;,&lt;FONT face="Consolas" size="5"&gt; filter&lt;FONT face="Consolas" size="5" color="#808080"&gt;(&lt;FONT face="Consolas" size="5"&gt; filter&lt;FONT face="Consolas" size="5" color="#808080"&gt;(&lt;FONT face="Consolas" size="5"&gt;[Date Creation]&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;[Année]&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;[Année]&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;members &lt;FONT face="Consolas" size="5" color="#808080"&gt;,&lt;FONT face="Consolas" size="5"&gt; [Date Creation]&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;[Année]&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;currentmember&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;name &lt;FONT face="Consolas" size="5" color="#808080"&gt;&amp;gt;&lt;FONT face="Consolas" size="5"&gt; "2016"&lt;FONT face="Consolas" size="5" color="#808080"&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;, &lt;FONT face="Consolas" size="5" color="#808080"&gt;(not&lt;FONT face="Consolas" size="5"&gt; isempty&lt;FONT face="Consolas" size="5" color="#808080"&gt;(&lt;FONT face="Consolas" size="5"&gt;[Measures]&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;[Nombre de h]&lt;FONT face="Consolas" size="5" color="#808080"&gt;) &lt;FONT face="Consolas" size="5" color="#808080"&gt;or &lt;FONT face="Consolas" size="5" color="#808080"&gt;not&lt;FONT face="Consolas" size="5"&gt; isempty&lt;FONT face="Consolas" size="5" color="#808080"&gt;(&lt;FONT face="Consolas" size="5"&gt;[Measures]&lt;FONT face="Consolas" size="5" color="#808080"&gt;.&lt;FONT face="Consolas" size="5"&gt;[Nombre de V]&lt;FONT face="Consolas" size="5" color="#808080"&gt;) &lt;FONT face="Consolas" size="5" color="#808080"&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;) &lt;FONT face="Consolas" size="5" color="#0000ff"&gt;on&lt;FONT face="Consolas" size="5"&gt; 1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;from&lt;FONT face="Consolas" size="5"&gt; mycube &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5" color="#808080"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5"&gt;&lt;FONT face="Consolas" size="5" color="#0000ff"&gt;&lt;FONT face="Consolas" size="5"&gt;How to migrate it?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 11:50:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-data/m-p/1024720#M13311</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-14T11:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-data/m-p/3412708#M129034</link>
      <description>&lt;P&gt;The MDX query you provided is selecting two calculated members, UN and Lib, which represent the unique name and the name of the current year member from the [Date Creation].[Année] hierarchy. Then, it's filtering the years to only include those after 2016 and where either of the measures [Measures].[Nombre de h] or [Measures].[Nombre de V] are not empty.&lt;/P&gt;
&lt;P&gt;To migrate this to DAX in Power BI, you'd do something like the following:&lt;/P&gt;
&lt;P&gt;First, you'd need to ensure that your SSAS Tabular model has the equivalent tables and columns that represent the [Date Creation].[Année] hierarchy and the two measures.&lt;/P&gt;
&lt;P&gt;Once you've confirmed that, you can start building your DAX query. You'd likely use the FILTER and CALCULATE functions to achieve the same result.&lt;/P&gt;
&lt;P&gt;Here's a rough translation of your MDX query to DAX:&lt;/P&gt;
&lt;P&gt;EVALUATE&lt;BR /&gt;VAR CurrentYear = YEAR(TODAY())&lt;/P&gt;
&lt;P&gt;RETURN&lt;BR /&gt;FILTER(&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;VALUES('Date Creation'[Année]),&lt;BR /&gt;"UN", 'Date Creation'[Année],&lt;BR /&gt;"Lib", 'Date Creation'[Année]&lt;BR /&gt;),&lt;BR /&gt;'Date Creation'[Année] &amp;gt; 2016 &lt;BR /&gt;&amp;amp;&amp;amp; (NOT(ISBLANK([Nombre de h])) || NOT(ISBLANK([Nombre de V])))&lt;BR /&gt;)&lt;BR /&gt;This DAX query starts by evaluating the current year. It then filters the [Année] column from the Date Creation table to only include years after 2016 and where either of the measures [Nombre de h] or [Nombre de V] are not blank. The ADDCOLUMNS function is used to add the UN and Lib columns to the result.&lt;/P&gt;
&lt;P&gt;You'd then use this DAX query in Power BI to create a table or visual that represents the same data as your original SSRS report. Remember, the exact names of tables, columns, and measures in your SSAS Tabular model might differ from my example, so you'd need to adjust the DAX query accordingly.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Sep 2023 17:28:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-data/m-p/3412708#M129034</guid>
      <dc:creator>technolog</dc:creator>
      <dc:date>2023-09-03T17:28:05Z</dc:date>
    </item>
  </channel>
</rss>

