<?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: Count Milestones Estimated in the Past in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Milestones-Estimated-in-the-Past/m-p/4351523#M172804</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="902026" data-lia-user-login="Gandarthvader" class="lia-mention lia-mention-user"&gt;Gandarthvader&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can create a &lt;EM&gt;&lt;STRONG&gt;calculated column&lt;/STRONG&gt;&lt;/EM&gt; as below in the table to get it, please find the details in&lt;EM&gt;&lt;STRONG&gt; the attachment&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
VAR _m1 =
    IF (
        'Table'[ProjectID] &amp;lt;= TODAY ()
            &amp;amp;&amp;amp; 'Table'[ProjectIDActual] = "Estimate",
        1,
        0
    )
VAR _m2 =
    IF (
        'Table'[Feasibility] &amp;lt;= TODAY ()
            &amp;amp;&amp;amp; 'Table'[FeasibilityActual] = "Estimate",
        1,
        0
    )
VAR _m3 =
    IF (
        'Table'[DueDiligence] &amp;lt;= TODAY ()
            &amp;amp;&amp;amp; 'Table'[DueDiligenceActual] = "Estimate",
        1,
        0
    )
VAR _m4 =
    IF ( 'Table'[PreCon] &amp;lt;= TODAY () &amp;amp;&amp;amp; 'Table'[PreConActual] = "Estimate", 1, 0 )
VAR _m5 =
    IF ( 'Table'[ConStrt] &amp;lt;= TODAY () &amp;amp;&amp;amp; 'Table'[ConStrtActual] = "Estimate", 1, 0 )
VAR _m6 =
    IF (
        'Table'[ConCompl] &amp;lt;= TODAY ()
            &amp;amp;&amp;amp; 'Table'[ConComplActual] = "Estimate",
        1,
        0
    )
VAR _m7 =
    IF (
        'Table'[Integration] &amp;lt;= TODAY ()
            &amp;amp;&amp;amp; 'Table'[IntegrationActual] = "Estimate",
        1,
        0
    )
VAR _m8 =
    IF ( 'Table'[PostCon] &amp;lt;= TODAY () &amp;amp;&amp;amp; 'Table'[PostConActual] = "Estimate", 1, 0 )
VAR _m9 =
    IF (
        'Table'[GrandOpen] &amp;lt;= TODAY ()
            &amp;amp;&amp;amp; 'Table'[GrandOpenActual] = "Estimate",
        1,
        0
    )
RETURN
    _m1 + _m2 + _m3 + _m4 + _m5 + _m6 + _m7 + _m8 + _m9&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jan 2025 07:46:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-01-06T07:46:15Z</dc:date>
    <item>
      <title>Count Milestones Estimated in the Past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Milestones-Estimated-in-the-Past/m-p/4350197#M172760</link>
      <description>&lt;P&gt;Hello, I'm not sure if this is doable the way I'm envisioning it. I have a card and I want to show a numerical count on it of milestones estimated in the past (including today) on projects. The table that I'm working with has unique project numbers and 9 milestones for each project number. The milestones each have a column for the date that the milestone is to be completed and then an "Actual" column where the milestone is set to either "Estimate" or "Actual". If it's set to "Actual" I would have the card ignore it, or if it's set to "Estimate" but the date is in the future, the count should ignore it. But, if it's set to "Estimate" and the date is today's date or in the past, I'd like to have it counted and added to the tally on the card.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here are the individual milestone column names: &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ProjectID, ProjectIDActual&lt;/P&gt;&lt;P&gt;Feasibility, FeasibilityActual&lt;/P&gt;&lt;P&gt;DueDiligence, DueDiligenceActual&lt;/P&gt;&lt;P&gt;PreCon, PreConActual&lt;/P&gt;&lt;P&gt;ConStrt, ConStrtActual&lt;/P&gt;&lt;P&gt;ConCompl, ConComplActual&lt;/P&gt;&lt;P&gt;Integration, IntegrationActual&lt;/P&gt;&lt;P&gt;PostCon, PostConActual&lt;/P&gt;&lt;P&gt;GrandOpen, GrandOpenActual&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first column for each milestone shows the date that is pulled for it and the one showing "Actual" just will say either "Estimate" or "Actual" in it. For instance, for the 'GrandOpen' column it will show a date and the 'GrandOpenActual' column will say whether it's Actual or Estimate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So to recap; I'd like to see if there's a way to get a card to display a count of how many milestones are showing Estimate with today's date or a date in the past. Is this possible in one DAX function? Would it be set up as a measure and added to the card or best to make it a column on the table itself?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much in advance for any help!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 19:27:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Milestones-Estimated-in-the-Past/m-p/4350197#M172760</guid>
      <dc:creator>Gandarthvader</dc:creator>
      <dc:date>2025-01-03T19:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: Count Milestones Estimated in the Past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Milestones-Estimated-in-the-Past/m-p/4350450#M172770</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="902026" data-lia-user-login="Gandarthvader" class="lia-mention lia-mention-user"&gt;Gandarthvader&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here’s a DAX measure to count milestones that are "Estimate" and have a date of today or in the past.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Estimated Milestones Count =
VAR MilestonesToCheck = {
    ('Table'[Feasibility], 'Table'[FeasibilityActual]),
    ('Table'[DueDiligence], 'Table'[DueDiligenceActual]),
    ('Table'[PreCon], 'Table'[PreConActual]),
    ('Table'[ConStrt], 'Table'[ConStrtActual]),
    ('Table'[ConCompl], 'Table'[ConComplActual]),
    ('Table'[Integration], 'Table'[IntegrationActual]),
    ('Table'[PostCon], 'Table'[PostConActual]),
    ('Table'[GrandOpen], 'Table'[GrandOpenActual])
}
RETURN
COUNTROWS(
    FILTER(
        ADDCOLUMNS(
            MilestonesToCheck,
            "MilestoneDate", [Value1],
            "Status", [Value2]
        ),
        [Status] = "Estimate" &amp;amp;&amp;amp; [MilestoneDate] &amp;lt;= TODAY()
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;MilestonesToCheck is a virtual table containing all milestone dates and their corresponding "Actual" columns.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The FILTER function ensures only milestones marked as "Estimate" with a date today or earlier are counted.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The COUNTROWS function returns the number of qualifying milestones.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If You Want a Simpler Approach:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Power BI doesn't have a direct way to iterate through multiple columns dynamically. If simplicity is your goal, the best way is to unpivot your milestone columns in Power Query, making it easier to handle with a basic DAX formula.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;That would significantly simplify the DAX.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 05:10:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Milestones-Estimated-in-the-Past/m-p/4350450#M172770</guid>
      <dc:creator>DataNinja777</dc:creator>
      <dc:date>2025-01-04T05:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Count Milestones Estimated in the Past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Milestones-Estimated-in-the-Past/m-p/4350476#M172772</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="902026" data-lia-user-login="Gandarthvader" class="lia-mention lia-mention-user"&gt;Gandarthvader&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;To count milestones with "Estimate" where the date is today or in the past:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create a Measure&lt;/STRONG&gt;: Write a DAX measure to filter rows for each milestone:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Check if Actual = "Estimate".&lt;/LI&gt;&lt;LI&gt;Check if the milestone date ≤ Today().&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MilestonesPastOrTodayEstimate =
    COUNTROWS(
        FILTER(
            YourTableName,
            (YourTableName[FeasibilityActual] = "Estimate" &amp;amp;&amp;amp; YourTableName[Feasibility] &amp;lt;= TODAY()) ||
            (YourTableName[DueDiligenceActual] = "Estimate" &amp;amp;&amp;amp; YourTableName[DueDiligence] &amp;lt;= TODAY()) ||
            (YourTableName[PreConActual] = "Estimate" &amp;amp;&amp;amp; YourTableName[PreCon] &amp;lt;= TODAY()) ||
            (YourTableName[ConStrtActual] = "Estimate" &amp;amp;&amp;amp; YourTableName[ConStrt] &amp;lt;= TODAY()) ||
            (YourTableName[ConComplActual] = "Estimate" &amp;amp;&amp;amp; YourTableName[ConCompl] &amp;lt;= TODAY()) ||
            (YourTableName[IntegrationActual] = "Estimate" &amp;amp;&amp;amp; YourTableName[Integration] &amp;lt;= TODAY()) ||
            (YourTableName[PostConActual] = "Estimate" &amp;amp;&amp;amp; YourTableName[PostCon] &amp;lt;= TODAY()) ||
            (YourTableName[GrandOpenActual] = "Estimate" &amp;amp;&amp;amp; YourTableName[GrandOpen] &amp;lt;= TODAY())
        )
    )
​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This measure evaluates all milestones, checks the conditions, and sums the results for the card.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Add to a Card&lt;/STRONG&gt;: Drag this measure into a card visual to display the count dynamically.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution, this will help others!&lt;/STRONG&gt;&lt;BR /&gt;If my response(s) assisted you in any way, don't forget to drop me a "&lt;STRONG&gt;Kudos&lt;/STRONG&gt;" &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;BR /&gt;Poojara&lt;BR /&gt;Data Analyst | MSBI Developer | Power BI Consultant&lt;BR /&gt;&lt;STRONG&gt;Consider Subscribing my YouTube for Beginners/Advance Concepts:&lt;/STRONG&gt;&amp;nbsp;&lt;A href="https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS" target="_self"&gt;https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 06:45:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Milestones-Estimated-in-the-Past/m-p/4350476#M172772</guid>
      <dc:creator>Poojara_D12</dc:creator>
      <dc:date>2025-01-04T06:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Count Milestones Estimated in the Past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Milestones-Estimated-in-the-Past/m-p/4351523#M172804</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="902026" data-lia-user-login="Gandarthvader" class="lia-mention lia-mention-user"&gt;Gandarthvader&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can create a &lt;EM&gt;&lt;STRONG&gt;calculated column&lt;/STRONG&gt;&lt;/EM&gt; as below in the table to get it, please find the details in&lt;EM&gt;&lt;STRONG&gt; the attachment&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
VAR _m1 =
    IF (
        'Table'[ProjectID] &amp;lt;= TODAY ()
            &amp;amp;&amp;amp; 'Table'[ProjectIDActual] = "Estimate",
        1,
        0
    )
VAR _m2 =
    IF (
        'Table'[Feasibility] &amp;lt;= TODAY ()
            &amp;amp;&amp;amp; 'Table'[FeasibilityActual] = "Estimate",
        1,
        0
    )
VAR _m3 =
    IF (
        'Table'[DueDiligence] &amp;lt;= TODAY ()
            &amp;amp;&amp;amp; 'Table'[DueDiligenceActual] = "Estimate",
        1,
        0
    )
VAR _m4 =
    IF ( 'Table'[PreCon] &amp;lt;= TODAY () &amp;amp;&amp;amp; 'Table'[PreConActual] = "Estimate", 1, 0 )
VAR _m5 =
    IF ( 'Table'[ConStrt] &amp;lt;= TODAY () &amp;amp;&amp;amp; 'Table'[ConStrtActual] = "Estimate", 1, 0 )
VAR _m6 =
    IF (
        'Table'[ConCompl] &amp;lt;= TODAY ()
            &amp;amp;&amp;amp; 'Table'[ConComplActual] = "Estimate",
        1,
        0
    )
VAR _m7 =
    IF (
        'Table'[Integration] &amp;lt;= TODAY ()
            &amp;amp;&amp;amp; 'Table'[IntegrationActual] = "Estimate",
        1,
        0
    )
VAR _m8 =
    IF ( 'Table'[PostCon] &amp;lt;= TODAY () &amp;amp;&amp;amp; 'Table'[PostConActual] = "Estimate", 1, 0 )
VAR _m9 =
    IF (
        'Table'[GrandOpen] &amp;lt;= TODAY ()
            &amp;amp;&amp;amp; 'Table'[GrandOpenActual] = "Estimate",
        1,
        0
    )
RETURN
    _m1 + _m2 + _m3 + _m4 + _m5 + _m6 + _m7 + _m8 + _m9&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 07:46:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Milestones-Estimated-in-the-Past/m-p/4351523#M172804</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-06T07:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Count Milestones Estimated in the Past</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Milestones-Estimated-in-the-Past/m-p/4352030#M172820</link>
      <description>&lt;P&gt;Thank you so much! That seems to have worked. One of the measure options that was posted also worked to count the rows which I could have worked with, but this actually counted each past milestone so I think it will work best. Thanks again!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 14:35:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Milestones-Estimated-in-the-Past/m-p/4352030#M172820</guid>
      <dc:creator>Gandarthvader</dc:creator>
      <dc:date>2025-01-06T14:35:56Z</dc:date>
    </item>
  </channel>
</rss>

