<?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 Dax Returned statement Help in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Returned-statement-Help/m-p/3948250#M153375</link>
    <description>&lt;DIV&gt;&lt;SPAN&gt;ok so the top had of my DAx is running fine as it should but then I get down to the return part I am running into issues. I am trying to have it print off a 2,1,-1or -2 to based off what it get from "latest status" which hold two values. I need hep because I need to change itto catch certain combos like if&amp;nbsp;"latest status" is -2,2 &amp;amp; 2,-2 &amp;amp; 2 ,2 &amp;amp; 2,1 and so on. As long as there is one 2 present it print 2 and same with 1 also lons as 1 is the greatest value it print 1 Examples if its 1,-1&amp;amp; -1,1 &amp;amp;1,-2 &amp;amp; -2,1 it prints 1 and for combos like&amp;nbsp; -1,-1 it print -1 and for -2 -2 it prints -2.&amp;nbsp; tried switching the and to or but it let all combos through.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FIND("2", LatestStatus, 1, 0) &amp;gt; 0 &amp;amp;&amp;amp; FIND("-2", LatestStatus, 1, 0) = 0, "2",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FIND("1", LatestStatus, 1, 0) &amp;gt; 0 &amp;amp;&amp;amp; FIND("-1", LatestStatus, 1, 0) = 0, "1",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FIND("-2", LatestStatus, 1, 0) &amp;gt; 0, "-2",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FIND("-1", LatestStatus, 1, 0) &amp;gt; 0, "-1",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"BLANK"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 24 May 2024 17:29:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-05-24T17:29:32Z</dc:date>
    <item>
      <title>Dax Returned statement Help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Returned-statement-Help/m-p/3948250#M153375</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;ok so the top had of my DAx is running fine as it should but then I get down to the return part I am running into issues. I am trying to have it print off a 2,1,-1or -2 to based off what it get from "latest status" which hold two values. I need hep because I need to change itto catch certain combos like if&amp;nbsp;"latest status" is -2,2 &amp;amp; 2,-2 &amp;amp; 2 ,2 &amp;amp; 2,1 and so on. As long as there is one 2 present it print 2 and same with 1 also lons as 1 is the greatest value it print 1 Examples if its 1,-1&amp;amp; -1,1 &amp;amp;1,-2 &amp;amp; -2,1 it prints 1 and for combos like&amp;nbsp; -1,-1 it print -1 and for -2 -2 it prints -2.&amp;nbsp; tried switching the and to or but it let all combos through.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FIND("2", LatestStatus, 1, 0) &amp;gt; 0 &amp;amp;&amp;amp; FIND("-2", LatestStatus, 1, 0) = 0, "2",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FIND("1", LatestStatus, 1, 0) &amp;gt; 0 &amp;amp;&amp;amp; FIND("-1", LatestStatus, 1, 0) = 0, "1",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FIND("-2", LatestStatus, 1, 0) &amp;gt; 0, "-2",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FIND("-1", LatestStatus, 1, 0) &amp;gt; 0, "-1",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"BLANK"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 May 2024 17:29:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Returned-statement-Help/m-p/3948250#M153375</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-24T17:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Returned statement Help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Returned-statement-Help/m-p/3948374#M153378</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would this help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;RETURN
	IF(
		FIND( "-2", LatestStatus, 1, 0 ) &amp;gt; 0,
		"-2",
		IF(
			FIND( "-1", LatestStatus, 1, 0 ) &amp;gt; 0,
			"-1",
			IF(
				FIND( "2", LatestStatus, 1, 0 ) &amp;gt; 0,
				"2",
				IF(
					FIND( "1", LatestStatus, 1, 0 ) &amp;gt; 0,
					"1",
					"BLANK"
				)
			)
		)
	)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 18:56:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Returned-statement-Help/m-p/3948374#M153378</guid>
      <dc:creator>gmsamborn</dc:creator>
      <dc:date>2024-05-24T18:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Returned statement Help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Returned-statement-Help/m-p/3948744#M153392</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can refer to below method.&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;LI-CODE lang="markup"&gt;RETURN = 
VAR LatestStatus = 'Table'[Latest Status]
VAR SplitPositions = 
    UNION(
        SELECTCOLUMNS({0},"Position",[Value]),
        DISTINCT(FILTER(SELECTCOLUMNS(GENERATESERIES(1,LEN(LatestStatus )),"Position",FIND(",",LatestStatus ,[Value],BLANK())),[Position]&amp;lt;&amp;gt;BLANK())),
        {LEN(LatestStatus )+1}
    )
VAR SplitPosition_AddIndex = ADDCOLUMNS(SplitPositions,"Index",RANKX(SplitPositions,[Position],,1))
VAR NumList = 
    SELECTCOLUMNS(
        GENERATESERIES(1,COUNTROWS(SplitPositions)-1),
        "Num",
            VAR Start_ = SUMMARIZE(FILTER(SplitPosition_AddIndex,[Index]=[Value]),[Position])+1
            VAR End_ = SUMMARIZE(FILTER(SplitPosition_AddIndex,[Index]=[Value]+1),[Position])
            RETURN
            MID(LatestStatus ,Start_,End_-Start_)*1
    )
RETURN
MAXX(NumList,[Num])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!Avkq2QNvDlkrwUFZOnli6lpcZ8BH?e=lnm6od" target="_blank"&gt;Demo - Dax Returned statement Help.pbix&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2024 04:29:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Returned-statement-Help/m-p/3948744#M153392</guid>
      <dc:creator>xifeng_L</dc:creator>
      <dc:date>2024-05-25T04:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Returned statement Help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Returned-statement-Help/m-p/3952831#M153468</link>
      <description>&lt;P&gt;So sorryfor not responding, I started working on something else and just did not get an update notification from my posted question so I'll tries methods now and get back to everyone who responded to help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 15:59:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Returned-statement-Help/m-p/3952831#M153468</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-27T15:59:22Z</dc:date>
    </item>
  </channel>
</rss>

