<?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: Help with a Measure DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-a-Measure-DAX/m-p/4646749#M177863</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;, thank you for your feedback.&amp;nbsp;These steps you explained are exactly how i did it, but they don't work&lt;/P&gt;</description>
    <pubDate>Thu, 10 Apr 2025 11:31:41 GMT</pubDate>
    <dc:creator>Elisa_Costanza</dc:creator>
    <dc:date>2025-04-10T11:31:41Z</dc:date>
    <item>
      <title>Help with a Measure DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-a-Measure-DAX/m-p/4646670#M177860</link>
      <description>&lt;P&gt;Good morning! I need your help with a DAX measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data model is composed of:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;A fact table called &lt;/SPAN&gt;&lt;SPAN&gt;"assunta_datamodel_vehicles_calendar"&lt;/SPAN&gt;&lt;SPAN&gt;, it contains multiple VINs over several Month/Year rows because a vehicle's warranty can extend over multiple months.&amp;nbsp;which contains the following columns:&lt;/SPAN&gt;&lt;/LI&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;active_days&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;activity_rate&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;n_days&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;VIN_CD (key that links the fact table to the DIM table cv_datamodel_usecase_vehicles)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;year_month (key that links the fact table to the DIM table cv_datamodel_calendar.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;A dimension table&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;cv_datamodel_calendar&lt;/SPAN&gt;&lt;SPAN&gt;, containing the calendar, with the following columns:&lt;/SPAN&gt;&lt;/LI&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;DAY_DT (date format)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;MONTH_NM&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;WEEK&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;YEAR_MONTH (linked with the fact table)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;YEAR_NM&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;YEAR_WEEK_CD&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Another dimension table&lt;/SPAN&gt;&lt;SPAN&gt;"cv_datamodel_usecase_vehicles"&lt;/SPAN&gt;&lt;SPAN&gt; that filters the fact table and contains the vehicle information (VIN is the unique vehicle key), with the following fields:&lt;/SPAN&gt;&lt;/LI&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;VIN_CD (unique key linking to the fact table)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Brand_cd&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Division_cd&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Base_warranty_start_date&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I need to filter the fact table by both calendar and vehicle dimension table. I need a DAX measure that calculates the sum of activity_rate, considering only the vehicles whose warranty date is between the MaxDate selected from the calendar and -24 months.&lt;BR /&gt;So far, I’ve written the first part for handling calendar dates by creating two variables:&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;TEST_DATE =&lt;BR /&gt;VAR MaxDate = MAX(cv_datamodel_calendar[DAY_DT])&lt;BR /&gt;VAR MinDate = EOMONTH(MaxDate, -24)&lt;BR /&gt;RETURN&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Now, I need to add the &lt;SPAN&gt;SUM of activity_rate, filtered for the vehicles that have a Base_warranty_start_date between MaxDate and MinDate. &lt;/SPAN&gt;Keep in mind that this column is of type text and formatted like this: 2023-03-14 (yyyy-mm-dd).&lt;BR /&gt;As a first step, I create a column in date format so I can filter correctly while keeping the yyyy-mm-dd order, and then I create the&amp;nbsp; DAX measure "&lt;/P&gt;&lt;P&gt;TEST11 =&lt;BR /&gt;VAR MaxDate = MAX(cv_datamodel_calendar[DAY_DT])&lt;BR /&gt;VAR MinDate = EOMONTH(MaxDate, -24)&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(assunta_datamodel_vehicles_calendar[activity_rate]),&lt;BR /&gt;FILTER(&lt;BR /&gt;assunta_datamodel_vehicles_calendar,&lt;BR /&gt;&lt;BR /&gt;RELATED(cv_datamodel_usecase_vehicles[DataFormattata]) &amp;gt;= MinDate &amp;amp;&amp;amp;&lt;BR /&gt;RELATED(cv_datamodel_usecase_vehicles[DataFormattata]) &amp;lt;= MaxDate &amp;amp;&amp;amp;&lt;BR /&gt;&lt;BR /&gt;assunta_datamodel_vehicles_calendar[year_month] &amp;gt;= FORMAT(MinDate, "YYYY-MM") &amp;amp;&amp;amp;&lt;BR /&gt;assunta_datamodel_vehicles_calendar[year_month] &amp;lt;= FORMAT(MaxDate, "YYYY-MM")&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;SPAN&gt;" &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;but after several test&amp;nbsp;the formula does not work correctly. Can someone help me understand?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 10:57:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-a-Measure-DAX/m-p/4646670#M177860</guid>
      <dc:creator>Elisa_Costanza</dc:creator>
      <dc:date>2025-04-10T10:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a Measure DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-a-Measure-DAX/m-p/4646724#M177862</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="924217" data-lia-user-login="Elisa_Costanza" class="lia-mention lia-mention-user"&gt;Elisa_Costanza&lt;/a&gt;&amp;nbsp;First, ensure that the Base_warranty_start_date column in the cv_datamodel_usecase_vehicles table is correctly converted to a date format. You can create a calculated column for this:&lt;/P&gt;
&lt;P&gt;DAX&lt;BR /&gt;DataFormattata = DATE(&lt;BR /&gt;LEFT(cv_datamodel_usecase_vehicles[Base_warranty_start_date], 4),&lt;BR /&gt;MID(cv_datamodel_usecase_vehicles[Base_warranty_start_date], 6, 2),&lt;BR /&gt;RIGHT(cv_datamodel_usecase_vehicles[Base_warranty_start_date], 2)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DAX&lt;BR /&gt;TEST11 =&lt;BR /&gt;VAR MaxDate = MAX(cv_datamodel_calendar[DAY_DT])&lt;BR /&gt;VAR MinDate = EOMONTH(MaxDate, -24)&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(assunta_datamodel_vehicles_calendar[activity_rate]),&lt;BR /&gt;FILTER(&lt;BR /&gt;assunta_datamodel_vehicles_calendar,&lt;BR /&gt;RELATED(cv_datamodel_usecase_vehicles[DataFormattata]) &amp;gt;= MinDate &amp;amp;&amp;amp;&lt;BR /&gt;RELATED(cv_datamodel_usecase_vehicles[DataFormattata]) &amp;lt;= MaxDate &amp;amp;&amp;amp;&lt;BR /&gt;assunta_datamodel_vehicles_calendar[year_month] &amp;gt;= FORMAT(MinDate, "YYYY-MM") &amp;amp;&amp;amp;&lt;BR /&gt;assunta_datamodel_vehicles_calendar[year_month] &amp;lt;= FORMAT(MaxDate, "YYYY-MM")&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 11:21:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-a-Measure-DAX/m-p/4646724#M177862</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-04-10T11:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a Measure DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-a-Measure-DAX/m-p/4646749#M177863</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;, thank you for your feedback.&amp;nbsp;These steps you explained are exactly how i did it, but they don't work&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 11:31:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-a-Measure-DAX/m-p/4646749#M177863</guid>
      <dc:creator>Elisa_Costanza</dc:creator>
      <dc:date>2025-04-10T11:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a Measure DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-a-Measure-DAX/m-p/4646775#M177868</link>
      <description>&lt;P&gt;Can you share what it is the issue you are facing&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 11:37:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-a-Measure-DAX/m-p/4646775#M177868</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-04-10T11:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a Measure DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-a-Measure-DAX/m-p/4654043#M178163</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="924217" data-lia-user-login="Elisa_Costanza" class="lia-mention lia-mention-user"&gt;Elisa_Costanza&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I ask if you have resolved this issue? if not could you please share more details on the issue to provide better resolutions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you issue got resolved, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 14:02:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-a-Measure-DAX/m-p/4654043#M178163</guid>
      <dc:creator>v-sathmakuri</dc:creator>
      <dc:date>2025-04-15T14:02:33Z</dc:date>
    </item>
  </channel>
</rss>

