<?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 Calculated Column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2796195#M87987</link>
    <description>&lt;P&gt;I’m trying to set up a column that would be used as a flag, using conditionals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an ‘informational’ table, and another table named ‘repeatable’. There is one record per record_id in my informational table, but multiple records per record_id in my repeatable table. It’s joining on record_id (one to many).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a conditional column created in my informational table, referencing a column (followupvisit) in my repeatable table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would go something like this….&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if followupvisit has 0 only, then "first follow up visit completed",&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if followupvisit includes a 0 and 1, then "2nd follow up visit completed",&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if followupvisit includes a 0, 1, and 2, then "all follow up visits completed", &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;else “no follow up visits completed”.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example of my data&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;So for record_id 3, after I would create this new column, I’d have one row reflected here and it would say “2nd follow up visit completed” since there are 2 records in the repeatable table showing one with a 0 and one with a 1 in the followupvisit column. For records 4 and 5, it would say “no follow up visits completed”, since there weren’t any values in the followupvisit column in the repeatable table..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone assist me with the dax for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Sep 2022 11:39:07 GMT</pubDate>
    <dc:creator>KWelsh8144</dc:creator>
    <dc:date>2022-09-26T11:39:07Z</dc:date>
    <item>
      <title>Calculated Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2796195#M87987</link>
      <description>&lt;P&gt;I’m trying to set up a column that would be used as a flag, using conditionals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an ‘informational’ table, and another table named ‘repeatable’. There is one record per record_id in my informational table, but multiple records per record_id in my repeatable table. It’s joining on record_id (one to many).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a conditional column created in my informational table, referencing a column (followupvisit) in my repeatable table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would go something like this….&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if followupvisit has 0 only, then "first follow up visit completed",&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if followupvisit includes a 0 and 1, then "2nd follow up visit completed",&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if followupvisit includes a 0, 1, and 2, then "all follow up visits completed", &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;else “no follow up visits completed”.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example of my data&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;So for record_id 3, after I would create this new column, I’d have one row reflected here and it would say “2nd follow up visit completed” since there are 2 records in the repeatable table showing one with a 0 and one with a 1 in the followupvisit column. For records 4 and 5, it would say “no follow up visits completed”, since there weren’t any values in the followupvisit column in the repeatable table..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone assist me with the dax for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 11:39:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2796195#M87987</guid>
      <dc:creator>KWelsh8144</dc:creator>
      <dc:date>2022-09-26T11:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2798778#M88010</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="60343" data-lia-user-login="KWelsh8144" class="lia-mention lia-mention-user"&gt;KWelsh8144&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I mocked up a table (persumed as information table in your case), can you please try the below code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;no of visits = 
var _maxvalue = CALCULATE(MAX('Table'[followupvisit]),FILTER( ALLEXCEPT('Table','Table'[id]),'Table'[id] = 'Table'[id]))
return  
SWITCH(_maxvalue, 
0, "first follow up visit completed",
1, "2nd follow up visit completed",
2, "all follow up visits completed",
"no follow up visits completed"
)&lt;/LI-CODE&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;I think this is what you are expecting...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;AnthonyJoseph&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 07:01:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2798778#M88010</guid>
      <dc:creator>AnthonyJoseph</dc:creator>
      <dc:date>2022-09-27T07:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2798909#M88016</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="60343" data-lia-user-login="KWelsh8144" class="lia-mention lia-mention-user"&gt;KWelsh8144&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;you can create one measure and one calculated column to meet your needs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;sum = CALCULATE(SUM('Table'[follow up visit]),FILTER(ALL('Table'),'Table'[record id]=SELECTEDVALUE('Table'[record id])))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = IF([sum]=BLANK(),"no follow up visits completed",IF([sum]=0,"first follow up visit completed",IF([sum]=1,"2nd follow up visit completed","all follow up visits completed")))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Community Support Team&amp;nbsp;&lt;STRONG&gt;Selina&amp;nbsp;zhu&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 07:40:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2798909#M88016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-27T07:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2799156#M88031</link>
      <description>&lt;P&gt;CalculatedColumn=SWITCH(CONCATENATEX(CALCULATETABLE(VALUES(repeatable[&lt;SPAN&gt;followupvisit])),repeatable[followupvisit],"",repeatable[followupvisit]),"0",&lt;EM&gt;"first follow up visit completed","01","2nd follow up visit completed","012","all follow up visits completed",“no follow up visits completed”)&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 08:48:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2799156#M88031</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2022-09-27T08:48:10Z</dc:date>
    </item>
  </channel>
</rss>

