<?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 Looking for ideas on UNIONX or DISTINCTX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-ideas-on-UNIONX-or-DISTINCTX/m-p/3551139#M136604</link>
    <description>&lt;P&gt;I am still looking for ways to work around the missing UNIONX command in DAX - the ability to append an arbitrary number of table variables or more precisely lists (single column table variables) inside a table variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the Power Query equivalent:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = #table({"Start","End"},{{2,3},{3,4},{6,7}}),
    #"Added Custom" = Table.AddColumn(Source, "Custom", each {[Start]..[End]})
in
    List.Distinct(List.Combine(#"Added Custom"[Custom]))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The main premise is to handle more than two overlapping intervals without duplication of the sample points (EDIT: while also accounting for gaps). It is extremely easy to do in Power Query as per the above, and it is reasonably easy to do graphically. But the numerical solution eludes me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I have raised an idea for UNIONX back in 2021 and it has so far roared to a single vote - mine. &lt;A href="https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=74eafba6-a723-ec11-b76a-281878de77da" target="_blank" rel="noopener"&gt;Microsoft Idea&lt;/A&gt;)&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Nov 2023 20:55:49 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2023-11-24T20:55:49Z</dc:date>
    <item>
      <title>Looking for ideas on UNIONX or DISTINCTX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-ideas-on-UNIONX-or-DISTINCTX/m-p/3551139#M136604</link>
      <description>&lt;P&gt;I am still looking for ways to work around the missing UNIONX command in DAX - the ability to append an arbitrary number of table variables or more precisely lists (single column table variables) inside a table variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the Power Query equivalent:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = #table({"Start","End"},{{2,3},{3,4},{6,7}}),
    #"Added Custom" = Table.AddColumn(Source, "Custom", each {[Start]..[End]})
in
    List.Distinct(List.Combine(#"Added Custom"[Custom]))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The main premise is to handle more than two overlapping intervals without duplication of the sample points (EDIT: while also accounting for gaps). It is extremely easy to do in Power Query as per the above, and it is reasonably easy to do graphically. But the numerical solution eludes me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I have raised an idea for UNIONX back in 2021 and it has so far roared to a single vote - mine. &lt;A href="https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=74eafba6-a723-ec11-b76a-281878de77da" target="_blank" rel="noopener"&gt;Microsoft Idea&lt;/A&gt;)&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 20:55:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-ideas-on-UNIONX-or-DISTINCTX/m-p/3551139#M136604</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-11-24T20:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for ideas on UNIONX or DISTINCTX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-ideas-on-UNIONX-or-DISTINCTX/m-p/3551517#M136627</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I took a look at the Microsoft Idea you've provided since I was having a hard time understanding the logic of the dataset in this topic.&lt;BR /&gt;&lt;BR /&gt;Considering the dates scenario on the idea page, isn't this a possible solution in DAX :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVALUATE
SELECTCOLUMNS(
	GENERATE(
		VALUES('Table'[Start]),
		VAR EndDate = CALCULATE(MAX('Table'[End]))
		RETURN
			CALENDAR(
				'Table'[Start],
				EndDate
			)
	),
	"Date",
	[Date]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this dataset :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the result I've obtained:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here is the PowerBI file I've used :&amp;nbsp;&lt;A href="https://we.tl/t-9kiA3jSR8z" target="_blank"&gt;https://we.tl/t-9kiA3jSR8z&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this answer solves your problem!&lt;BR /&gt;If you need any additional help please &lt;SPAN&gt;@&lt;/SPAN&gt; me in your reply.&lt;BR /&gt;If my reply provided you with a solution, please consider marking it as a solution &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt; or giving it a kudo &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/jpessoa08" target="_blank"&gt;You can also check out my LinkedIn!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Jorge Pessoa&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 19:54:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-ideas-on-UNIONX-or-DISTINCTX/m-p/3551517#M136627</guid>
      <dc:creator>jpessoa8</dc:creator>
      <dc:date>2023-11-24T19:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for ideas on UNIONX or DISTINCTX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-ideas-on-UNIONX-or-DISTINCTX/m-p/3551539#M136629</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="525058" data-lia-user-login="jpessoa8" class="lia-mention lia-mention-user"&gt;jpessoa8&lt;/a&gt;&amp;nbsp; I will have to be more precise in my request.&amp;nbsp; Let's assume I have&amp;nbsp; an arbitrary number of lists.&amp;nbsp; For this exercise three lists will suffice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;List 1:&amp;nbsp; from 2 to 3&lt;/P&gt;
&lt;P&gt;List 2: from 3 to 4&lt;/P&gt;
&lt;P&gt;List 3: from 6 to 7&lt;/P&gt;
&lt;P style="line-height: 1.71429; font-family: SegoeUI, Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="line-height: 1.71429; font-family: SegoeUI, Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;Now I want to find the distinct values for the combination of all these lists, and the result should be&lt;/P&gt;
&lt;P style="line-height: 1.71429; font-family: SegoeUI, Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="line-height: 1.71429; font-family: SegoeUI, Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;2,3,4,6,7&lt;/P&gt;
&lt;P style="line-height: 1.71429; font-family: SegoeUI, Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the clarification will be that there will be overlaps between the lists&amp;nbsp;&lt;STRONG&gt;but also gaps&lt;/STRONG&gt;.&amp;nbsp; &amp;nbsp;Meaning that your Min/Max approach is not&amp;nbsp;&lt;SPAN&gt;applicable, unfortunately.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 20:57:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-ideas-on-UNIONX-or-DISTINCTX/m-p/3551539#M136629</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-11-24T20:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for ideas on UNIONX or DISTINCTX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-ideas-on-UNIONX-or-DISTINCTX/m-p/3552023#M136669</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you dind't look correctly to the outcome of the DAX expression. The MAX measures is just to get the corresping "end" list value for each "start" value. It will be the same if I used SELECTEDVALUE().&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Using your example of numeric lists, but with numbers even further apart:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;List1 : from 1 to 5&lt;/P&gt;&lt;P&gt;List2: from 10 to 14&lt;/P&gt;&lt;P&gt;List3: from 20 to 35&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The new calculated table DAX Expression :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;UNIOX_NUMERIC = 
DISTINCT(
	SELECTCOLUMNS(
		GENERATE(
			VALUES('NumericTable'[Start]),
			VAR EndValue = CALCULATE(MAX('NumericTable'[End]))
			RETURN
				GENERATESERIES(
					'NumericTable'[Start],
					EndValue
				)
		),
		"Value",
		[Value]
	)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this I got the following list of numbers:&lt;/P&gt;&lt;P&gt;1,2,3,4,5,10,11,12,13,14,20,21,222,23,24,25,26,27,28,29,30,31,32,33,34,35&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Isn't this what you were looking for?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is the PowerBI file with both scenarios :&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://we.tl/t-9kiA3jSR8z" target="_blank" rel="nofollow noopener noreferrer"&gt;https://we.tl/t-zNZ6WSSUSB&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For additional help, please &lt;SPAN&gt;@&lt;/SPAN&gt; me in your reply!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/jpessoa08" target="_blank"&gt;You can also check out my LinkedIn!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Jorge Pessoa&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2023 14:59:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-ideas-on-UNIONX-or-DISTINCTX/m-p/3552023#M136669</guid>
      <dc:creator>jpessoa8</dc:creator>
      <dc:date>2023-11-25T14:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for ideas on UNIONX or DISTINCTX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-ideas-on-UNIONX-or-DISTINCTX/m-p/3552154#M136672</link>
      <description>&lt;P&gt;Thank you, that approach works. Testing at scale now.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2023 18:22:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-ideas-on-UNIONX-or-DISTINCTX/m-p/3552154#M136672</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-11-25T18:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for ideas on UNIONX or DISTINCTX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-ideas-on-UNIONX-or-DISTINCTX/m-p/3552223#M136679</link>
      <description>&lt;P&gt;Here's a slightly different setup but the technical result is the same&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;UNIONX_NUMERIC = 
DISTINCT(
    SELECTCOLUMNS(
        GENERATE(
		SUMMARIZECOLUMNS(NumericTable[Start],NumericTable[End]),
		GENERATESERIES([Start],[End])
	),"Value",[Value]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 15:59:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-ideas-on-UNIONX-or-DISTINCTX/m-p/3552223#M136679</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-11-27T15:59:03Z</dc:date>
    </item>
  </channel>
</rss>

