<?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 Dax Query Month Year filter issue in Report Builder in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-Month-Year-filter-issue-in-Report-Builder/m-p/2067442#M46735</link>
    <description>&lt;DIV class="votecell post-layout--left"&gt;&lt;DIV class="js-voting-container d-flex jc-center fd-column ai-stretch gs4 fc-black-200"&gt;Hello,&lt;/DIV&gt;&lt;DIV class="js-voting-container d-flex jc-center fd-column ai-stretch gs4 fc-black-200"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="postcell post-layout--right"&gt;&lt;DIV class="s-prose js-post-body"&gt;&lt;P&gt;I have a report I have built in Power BI and I am copying over the Dax Query into Report Builder, which is being used as a filter for month year. I have changed the month year column to a date format in Power BI, as shown in the image below.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;However, when copying over the Dax Query it changes the MonthYear column to datetime. Here is the Dax Query:&lt;/P&gt;&lt;PRE&gt;  // DAX Query
DEFINE
  VAR __DS0FilterTable = 
    TREATAS({"FALSETRUE",
      "TRUEFALSE"}, 'edw amcs_prod_factTonnage'[Exclude/Include])

  VAR __DS0FilterTable2 = 
    TREATAS(
      {DATE(2021, 8, 1),
        DATE(2021, 9, 1),
        DATE(2021, 10, 1),
        DATE(2021, 11, 1),
        DATE(2021, 12, 1)},
     'edw dimDate'[MonthYear]
    )

  VAR __DS0FilterTable3 = 
    TREATAS({"2021"}, 'edw dimDate'[Year])

  VAR __DS0Core = 
    CALCULATETABLE(
      SUMMARIZE('edw dimDate', 'edw dimDate'[MonthYear], 'edw dimDate'[Month]),
      KEEPFILTERS(__DS0FilterTable),
      KEEPFILTERS(__DS0FilterTable2),
      KEEPFILTERS(__DS0FilterTable3)
    )

  VAR __DS0PrimaryWindowed = 
    TOPN(501, __DS0Core, 'edw dimDate'[Month], 1, 'edw dimDate'[MonthYear], 1)

EVALUATE
  __DS0PrimaryWindowed

ORDER BY
  'edw dimDate'[Month], 'edw dimDate'[MonthYear]&lt;/PRE&gt;&lt;P&gt;This is causing my Report Builder filter to show month year as a datetime, as shown below. It works fine, but looks weird. How to I go about fixing this, so it actually shows month year (September 2020)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I do this in the Dax Query or does it have to happen in Report Builder? Haven't had much success with either yet.&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 09 Sep 2021 18:25:03 GMT</pubDate>
    <dc:creator>PeteDTG</dc:creator>
    <dc:date>2021-09-09T18:25:03Z</dc:date>
    <item>
      <title>Dax Query Month Year filter issue in Report Builder</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-Month-Year-filter-issue-in-Report-Builder/m-p/2067442#M46735</link>
      <description>&lt;DIV class="votecell post-layout--left"&gt;&lt;DIV class="js-voting-container d-flex jc-center fd-column ai-stretch gs4 fc-black-200"&gt;Hello,&lt;/DIV&gt;&lt;DIV class="js-voting-container d-flex jc-center fd-column ai-stretch gs4 fc-black-200"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="postcell post-layout--right"&gt;&lt;DIV class="s-prose js-post-body"&gt;&lt;P&gt;I have a report I have built in Power BI and I am copying over the Dax Query into Report Builder, which is being used as a filter for month year. I have changed the month year column to a date format in Power BI, as shown in the image below.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;However, when copying over the Dax Query it changes the MonthYear column to datetime. Here is the Dax Query:&lt;/P&gt;&lt;PRE&gt;  // DAX Query
DEFINE
  VAR __DS0FilterTable = 
    TREATAS({"FALSETRUE",
      "TRUEFALSE"}, 'edw amcs_prod_factTonnage'[Exclude/Include])

  VAR __DS0FilterTable2 = 
    TREATAS(
      {DATE(2021, 8, 1),
        DATE(2021, 9, 1),
        DATE(2021, 10, 1),
        DATE(2021, 11, 1),
        DATE(2021, 12, 1)},
     'edw dimDate'[MonthYear]
    )

  VAR __DS0FilterTable3 = 
    TREATAS({"2021"}, 'edw dimDate'[Year])

  VAR __DS0Core = 
    CALCULATETABLE(
      SUMMARIZE('edw dimDate', 'edw dimDate'[MonthYear], 'edw dimDate'[Month]),
      KEEPFILTERS(__DS0FilterTable),
      KEEPFILTERS(__DS0FilterTable2),
      KEEPFILTERS(__DS0FilterTable3)
    )

  VAR __DS0PrimaryWindowed = 
    TOPN(501, __DS0Core, 'edw dimDate'[Month], 1, 'edw dimDate'[MonthYear], 1)

EVALUATE
  __DS0PrimaryWindowed

ORDER BY
  'edw dimDate'[Month], 'edw dimDate'[MonthYear]&lt;/PRE&gt;&lt;P&gt;This is causing my Report Builder filter to show month year as a datetime, as shown below. It works fine, but looks weird. How to I go about fixing this, so it actually shows month year (September 2020)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I do this in the Dax Query or does it have to happen in Report Builder? Haven't had much success with either yet.&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Sep 2021 18:25:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-Month-Year-filter-issue-in-Report-Builder/m-p/2067442#M46735</guid>
      <dc:creator>PeteDTG</dc:creator>
      <dc:date>2021-09-09T18:25:03Z</dc:date>
    </item>
  </channel>
</rss>

