<?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 Problem with Month-Year view in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4137112#M164332</link>
    <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I have a column formatted as date (called "_Vorauss. Baubeginn"). It includes data with day, month and year.&lt;/P&gt;&lt;P&gt;Now I would like to get the data aggregated to just month/year to use that in a filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My idea was to extract the year and mont (by using the MONTH/YEAR formular) and use the DATE forumla by entering Year Baubeginn, Month Baubeginn and 1 (as day).&lt;/P&gt;&lt;P&gt;Unfortunately I´m not able to select the year or month I extracted previously.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have an idea how I can solve this? Or am I thinking to complicated and there is a much easier way to get the month/year values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance for your help.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Sep 2024 08:26:45 GMT</pubDate>
    <dc:creator>grasa</dc:creator>
    <dc:date>2024-09-06T08:26:45Z</dc:date>
    <item>
      <title>Problem with Month-Year view</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4137112#M164332</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I have a column formatted as date (called "_Vorauss. Baubeginn"). It includes data with day, month and year.&lt;/P&gt;&lt;P&gt;Now I would like to get the data aggregated to just month/year to use that in a filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My idea was to extract the year and mont (by using the MONTH/YEAR formular) and use the DATE forumla by entering Year Baubeginn, Month Baubeginn and 1 (as day).&lt;/P&gt;&lt;P&gt;Unfortunately I´m not able to select the year or month I extracted previously.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have an idea how I can solve this? Or am I thinking to complicated and there is a much easier way to get the month/year values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance for your help.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 08:26:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4137112#M164332</guid>
      <dc:creator>grasa</dc:creator>
      <dc:date>2024-09-06T08:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Month-Year view</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4137146#M164335</link>
      <description>&lt;P&gt;To aggregate your date column (called "_Vorauss. Baubeginn") by month and year for use as a filter in Power BI, you can follow these steps:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Create a calculated column&lt;/STRONG&gt; that extracts the month and year from your date column "_Vorauss. Baubeginn".&lt;/P&gt;&lt;P&gt;You can use the following DAX formula to create a new column that shows the first day of the month for each date in your original column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MonthYearColumn = DATE(YEAR([_Vorauss. Baubeginn]), MONTH([_Vorauss. Baubeginn]), 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;This will give you a date formatted as the first day of each month, which can be used to group and filter your data by month and year.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Use the calculated column in a slicer or visual:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Now that you have a column with the year and month, you can use it in a slicer to filter your data by month and year.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;H3&gt;Alternative Approach (Using FORMAT):&lt;/H3&gt;&lt;P&gt;If you don't need the exact date and only want a textual representation (e.g., "January 2024"), you can create a calculated column with a formatted string for month and year:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MonthYearText = FORMAT([_Vorauss. Baubeginn], "MMM YYYY")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MonthYearText = FORMAT([_Vorauss. Baubeginn], "MMM YYYY")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have any issue please feel free and contact with me.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 08:43:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4137146#M164335</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-09-06T08:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Month-Year view</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4137202#M164337</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403667" data-lia-user-login="123abc" class="lia-mention lia-mention-user"&gt;123abc&lt;/a&gt;&amp;nbsp;thank you very much for your fast reply! I tried your first option but unfortunately it says that there weren´t found any data for that visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I´m not able to try the second option, there occures an error which says that the function "FORMAT" is not allowed in DAX expressions for calculated columns in DirectQuery models&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 09:02:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4137202#M164337</guid>
      <dc:creator>grasa</dc:creator>
      <dc:date>2024-09-06T09:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Month-Year view</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4137225#M164338</link>
      <description>&lt;P&gt;Thank you for your feedback! Since you're using &lt;STRONG&gt;DirectQuery&lt;/STRONG&gt;, it limits some of the DAX functions like FORMAT, which causes the error you're seeing. Let's tackle this issue by adjusting our approach to work within the DirectQuery constraints.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;Option 1: Workaround for Date Aggregation in DirectQuery&lt;/H3&gt;&lt;P&gt;We can avoid using functions that are not supported in DirectQuery, like FORMAT, and rely solely on DAX functions that are allowed.&lt;/P&gt;&lt;H4&gt;Step 1: Extract Year and Month&lt;/H4&gt;&lt;P&gt;Instead of using the FORMAT function, let's directly extract the year and month in numeric form and combine them.&lt;/P&gt;&lt;P&gt;Create two &lt;STRONG&gt;calculated columns&lt;/STRONG&gt; for &lt;STRONG&gt;Year&lt;/STRONG&gt; and &lt;STRONG&gt;Month&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;YearColumn = YEAR([_Vorauss. Baubeginn])&lt;BR /&gt;MonthColumn = MONTH([_Vorauss. Baubeginn])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H4&gt;Step 2: Combine Year and Month&lt;/H4&gt;&lt;P&gt;Since DirectQuery doesn’t allow FORMAT, we’ll combine the year and month into a new column as text without FORMAT:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;YearMonth = [YearColumn] * 100 + [MonthColumn]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will create a column like 202401 for January 2024, which you can use as a slicer or in visuals.&lt;/P&gt;&lt;P&gt;Alternatively, if you want a date for the first of the month, this formula will work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FirstOfMonth = DATE(YEAR([_Vorauss. Baubeginn]), MONTH([_Vorauss. Baubeginn]), 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H4&gt;Step 3: Use the New Column in Visuals&lt;/H4&gt;&lt;P&gt;Now, use either the YearMonth or FirstOfMonth column in your visuals or slicers to filter by month and year.&lt;/P&gt;&lt;H3&gt;Option 2: Modify Your Data Model (If Possible)&lt;/H3&gt;&lt;P&gt;If you have control over your data source, you could consider switching to &lt;STRONG&gt;Import Mode&lt;/STRONG&gt; rather than DirectQuery for more flexibility. Import Mode allows you to use functions like FORMAT and gives you more control over transformations.&lt;/P&gt;&lt;P&gt;Let me know if you encounter any further issues, and we’ll continue to refine the solution!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 09:20:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4137225#M164338</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-09-06T09:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Month-Year view</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4137289#M164341</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403667" data-lia-user-login="123abc" class="lia-mention lia-mention-user"&gt;123abc&lt;/a&gt;&amp;nbsp;Thanks again for your fast help&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;.&lt;/P&gt;&lt;P&gt;Unfortunately this is also not working, it says that the data for this visual isn´t found. Do you think this is because there are also blanks in the "_Vorauss. Baubeginn" column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I could switch to Import Mode and I also tried that earlier but then there occures an error saying it is not possible because there are some blanks in some tables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 10:08:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4137289#M164341</guid>
      <dc:creator>grasa</dc:creator>
      <dc:date>2024-09-06T10:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Month-Year view</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4137586#M164354</link>
      <description>&lt;P&gt;Yes, the issue you're facing could indeed be caused by the &lt;STRONG&gt;blanks&lt;/STRONG&gt; in the "_Vorauss. Baubeginn" column. When there are null values, calculations like DATE(), YEAR(), and MONTH() might fail or return unexpected results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can modify your DAX formulas to handle blanks by using the IF and ISBLANK functions, ensuring that calculations only happen when there is valid data.&lt;/P&gt;&lt;P&gt;For example, you can wrap the DATE function to avoid calculations when the value is blank:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FirstOfMonth = IF(&lt;BR /&gt;ISBLANK([_Vorauss. Baubeginn]),&lt;BR /&gt;BLANK(),&lt;BR /&gt;DATE(YEAR([_Vorauss. Baubeginn]), MONTH([_Vorauss. Baubeginn]), 1)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will return a blank value if "_Vorauss. Baubeginn" is blank, avoiding errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Replace Blanks with a Default Date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FirstOfMonth = IF(&lt;BR /&gt;ISBLANK([_Vorauss. Baubeginn]),&lt;BR /&gt;DATE(1900, 1, 1), // You can choose any default date here&lt;BR /&gt;DATE(YEAR([_Vorauss. Baubeginn]), MONTH([_Vorauss. Baubeginn]), 1)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This replaces the blank entries with a default date (e.g., January 1, 1900), ensuring no null values are present.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the switch to &lt;STRONG&gt;Import Mode&lt;/STRONG&gt; fails due to blanks in other tables, handling these blanks similarly—by either removing them or filling them with default values—can help resolve the issue.&lt;/P&gt;&lt;H4&gt;Steps to Handle Blanks Before Import Mode:&lt;/H4&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Check All Tables for Blanks:&lt;/STRONG&gt; Identify columns with blank values.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Fill Blanks:&lt;/STRONG&gt; Either use DAX or Power Query transformations to fill those blanks with a default value.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Switch to Import Mode:&lt;/STRONG&gt; After handling blanks, try switching again.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Let me know how this works for you!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 12:41:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4137586#M164354</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-09-06T12:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Month-Year view</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4139713#M164467</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="801300" data-lia-user-login="grasa" class="lia-mention lia-mention-user"&gt;grasa&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from&amp;nbsp;123abc&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you need to display the data of the month selected in the filter in the table visualization?&amp;nbsp;If I understand correctly, please refer to the following test, in my test, I use DiectQuery mode to connect two tables, one of the tables as a filter, if the data structure I use is different from yours, please feel free to correct me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table_1&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filter_table&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I created a measure as follows.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = IF(SELECTEDVALUE(filter_table[Date]) = BLANK(), 1, IF(YEAR(MAX([Date])) = YEAR(SELECTEDVALUE(filter_table[Date])) &amp;amp;&amp;amp; MONTH(MAX([Date])) = MONTH(SELECTEDVALUE(filter_table[Date])), 1, 0))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Put the measure into the visual-level filters, set up show items when the value is 1.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Put the Date field of filter_table into Filter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yulia Xu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 03:15:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4139713#M164467</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-09T03:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Month-Year view</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4166660#M165524</link>
      <description>&lt;P&gt;Sorry for the late reply. I don´t need the data in the filter section but as a visual like this, but only showing months and years, without days:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately the solution from&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403667" data-lia-user-login="123abc" class="lia-mention lia-mention-user"&gt;123abc&lt;/a&gt;&amp;nbsp;about handling blanks wasn´t working. If I create a new column there occurs an error:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if I try to create a measure, I´m not able to select the "_&lt;SPAN&gt;Vorauss. Baubeginn" column... Maybe I have to live with the day...&lt;span class="lia-unicode-emoji" title=":see_no_evil_monkey:"&gt;🙈&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 08:25:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4166660#M165524</guid>
      <dc:creator>grasa</dc:creator>
      <dc:date>2024-09-23T08:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Month-Year view</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4166808#M165531</link>
      <description>&lt;P&gt;Thanks to all for your help, I think I found a solution that works for me: I created a new calendar table which includes all the dates from my "_vorauss.Baubeginn" column. Within this table I created a new mmmm-yyyy column.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 09:21:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Month-Year-view/m-p/4166808#M165531</guid>
      <dc:creator>grasa</dc:creator>
      <dc:date>2024-09-23T09:21:56Z</dc:date>
    </item>
  </channel>
</rss>

