<?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 IF DAX Measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-IF-DAX-Measure/m-p/4263187#M168975</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="821151" data-lia-user-login="leerjones85" class="lia-mention lia-mention-user"&gt;leerjones85&lt;/a&gt;&amp;nbsp;&lt;SPAN&gt;It sounds like you’re trying to create a measure that compares dates and calculates different sums based on the condition. Here’s how you can achieve this in DAX:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;To get today's date:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TodayDate = 
CALCULATE(
    MAX('DIM_DATE'[DATETIME]),
    'DIM_DATE'[DAY_MINUS] = "Today"
)&lt;/LI-CODE&gt;&lt;P&gt;Main measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Actual vs Target Measure = 
IF(
    MAX('FACT_METRICS'[DATE]) &amp;lt; [TodayDate],
    CALCULATE(
        SUM('FACT_METRICS'[ACTUAL]) - SUM('FACT_METRICS'[TARGET])
    ),
    SUM('FACT_METRICS'[TARGET])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!!&lt;/P&gt;&lt;P&gt;If this solved your problem, please accept it as a solution and a kudos!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Shahariar Hafiz&lt;/P&gt;</description>
    <pubDate>Wed, 30 Oct 2024 03:55:46 GMT</pubDate>
    <dc:creator>shafiz_p</dc:creator>
    <dc:date>2024-10-30T03:55:46Z</dc:date>
    <item>
      <title>Help with IF DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-IF-DAX-Measure/m-p/4263152#M168972</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to Power BI and have got stuck when creating a measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a fact table the following columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'FACT_METRICS'[DATE]&lt;/P&gt;&lt;P&gt;'FACT_METRICS'[ACTUAL]&lt;/P&gt;&lt;P&gt;'FACT_METRICS'[TARGET]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dimension table with the following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'DIM_DATE'[DATETIME]&lt;/P&gt;&lt;P&gt;'DIM_DATE'[DAY_MINUS]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wanting to create a measure than returns the following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF 'FACT_METRICS'[DATE] &amp;lt; 'DIM_DATE'[DATETIME] WHERE 'DIM_DATE'[DAY_MINUS] = "Today" THEN CALCULATE(SUM('FACT_METRICS'[ACTUAL]) - SUM('FACT_METRICS'[TARGET])) ELSE SUM('FACT_METRICS'[TARGET])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is much appreciated,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 03:03:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-IF-DAX-Measure/m-p/4263152#M168972</guid>
      <dc:creator>leerjones85</dc:creator>
      <dc:date>2024-10-30T03:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help with IF DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-IF-DAX-Measure/m-p/4263187#M168975</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="821151" data-lia-user-login="leerjones85" class="lia-mention lia-mention-user"&gt;leerjones85&lt;/a&gt;&amp;nbsp;&lt;SPAN&gt;It sounds like you’re trying to create a measure that compares dates and calculates different sums based on the condition. Here’s how you can achieve this in DAX:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;To get today's date:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TodayDate = 
CALCULATE(
    MAX('DIM_DATE'[DATETIME]),
    'DIM_DATE'[DAY_MINUS] = "Today"
)&lt;/LI-CODE&gt;&lt;P&gt;Main measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Actual vs Target Measure = 
IF(
    MAX('FACT_METRICS'[DATE]) &amp;lt; [TodayDate],
    CALCULATE(
        SUM('FACT_METRICS'[ACTUAL]) - SUM('FACT_METRICS'[TARGET])
    ),
    SUM('FACT_METRICS'[TARGET])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!!&lt;/P&gt;&lt;P&gt;If this solved your problem, please accept it as a solution and a kudos!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Shahariar Hafiz&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 03:55:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-IF-DAX-Measure/m-p/4263187#M168975</guid>
      <dc:creator>shafiz_p</dc:creator>
      <dc:date>2024-10-30T03:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help with IF DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-IF-DAX-Measure/m-p/4263197#M168977</link>
      <description>&lt;P&gt;Thank You!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 04:07:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-IF-DAX-Measure/m-p/4263197#M168977</guid>
      <dc:creator>leerjones85</dc:creator>
      <dc:date>2024-10-30T04:07:37Z</dc:date>
    </item>
  </channel>
</rss>

