<?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: How to CALCULATE VAR table with USERELATIONSHIP in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-CALCULATE-VAR-table-with-USERELATIONSHIP/m-p/4107234#M162989</link>
    <description>&lt;P&gt;I don't know what's going on with all those filters and table calculations, but if you want to calculate a cummulative sum on that inactive date column, try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Ftd_sum2:=
VAR md = MAX('Calendar'[date])
RETURN CALCULATE(
	SUM('TEST_'[Qty]),
	USERELATIONSHIP('Calendar'[Date],'TEST_'[Calculated]),
	ALL('Calendar'),
	'Calendar'[Date]&amp;lt;=md)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;If you need additional filters, apply them to the page or visual filters...&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Aug 2024 15:41:11 GMT</pubDate>
    <dc:creator>sjoerdvn</dc:creator>
    <dc:date>2024-08-19T15:41:11Z</dc:date>
    <item>
      <title>How to CALCULATE VAR table with USERELATIONSHIP</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-CALCULATE-VAR-table-with-USERELATIONSHIP/m-p/4104416#M162880</link>
      <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;I have a table below,and want to sum [Qty] on variable table by cumulative and using inactive relationship&lt;BR /&gt;between [Calculated] and Calendar table.&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;Ftd_sum2:=
VAR tbl = 
    SELECTCOLUMNS(
        FILTER(ALL('TEST_'), 'TEST_'[STS] = "〇"),
        "@Trg", 'TEST_'[PN]
      )
VAR Dis =DISTINCT(tbl)   
VAR Ftd = 
    CALCULATETABLE(                                    
            'TEST_',filter(allselected('TEST_'),'TEST_'[PN] IN Dis),                                             
               USERELATIONSHIP('Calendar'[Date],'TEST_'[Calculated])
                    )  
VAR Result =
    CALCULATE(
        SUM('TEST_'[Qty]),
        KEEPFILTERS(Ftd),filter(allselected('Calendar'),
                     'Calendar'[Date]&amp;lt;=max('Calendar'[Date]))
              )
return 
Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Result is all blank..Upon checking the operarion,it caused when I added&amp;nbsp; USERELATIONSHIP on CACULATETABLE.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;img /&gt;&lt;P&gt;&lt;BR /&gt;This might be related to following article,I have no idea to do what I needed by using LOOKUPVALUE.&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/userelationship-in-calculated-columns/" target="_self"&gt;USERELATIONSHIP in calculated column&lt;/A&gt;&lt;BR /&gt;Could anyone teach me how to correct it on Excel powerpivot??&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 16 Aug 2024 14:59:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-CALCULATE-VAR-table-with-USERELATIONSHIP/m-p/4104416#M162880</guid>
      <dc:creator>ohnothimagain</dc:creator>
      <dc:date>2024-08-16T14:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to CALCULATE VAR table with USERELATIONSHIP</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-CALCULATE-VAR-table-with-USERELATIONSHIP/m-p/4104543#M162884</link>
      <description>&lt;P&gt;The following measure might help you or at least get you pointed in the right direction.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cumulative Sum = 
var _tbl = 
	DISTINCT(
		SELECTCOLUMNS(
		FILTER(ALL(TEST_), TEST_[STS] = "〇"),
		"@Trg", TEST_[PN]
	)
)
var _result = 
CALCULATE(
	SUM(TEST_[Qty]),
    ALL('calendar'),
	FILTER(TEST_, TEST_[Calculated] &amp;lt;= MAX(calendar[Date]) &amp;amp;&amp;amp; TEST_[PN] in _tbl),
	USERELATIONSHIP(TEST_[Calculated], calendar[Date])
)
RETURN
_result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2024 15:36:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-CALCULATE-VAR-table-with-USERELATIONSHIP/m-p/4104543#M162884</guid>
      <dc:creator>jgeddes</dc:creator>
      <dc:date>2024-08-16T15:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to CALCULATE VAR table with USERELATIONSHIP</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-CALCULATE-VAR-table-with-USERELATIONSHIP/m-p/4105629#M162925</link>
      <description>&lt;P&gt;Thank you for replying quickly! I tried right away,but result was unfortunately unsuccess.&lt;BR /&gt;--&amp;gt;putting userelationship on "calculated column" seems preventing&lt;BR /&gt;&lt;BR /&gt;I've put this excel file on OneDrive,please teach me if you have more ideas.&lt;BR /&gt;&lt;A href="https://1drv.ms/x/c/358c67390849f278/Ee779DtIOa1OmNsQhcjwjO4BWTyYiy2NUVCDWnL91DQZsA?e=XimUs4" target="_self"&gt;OneDrive&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2024 11:14:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-CALCULATE-VAR-table-with-USERELATIONSHIP/m-p/4105629#M162925</guid>
      <dc:creator>ohnothimagain</dc:creator>
      <dc:date>2024-08-18T11:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to CALCULATE VAR table with USERELATIONSHIP</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-CALCULATE-VAR-table-with-USERELATIONSHIP/m-p/4107234#M162989</link>
      <description>&lt;P&gt;I don't know what's going on with all those filters and table calculations, but if you want to calculate a cummulative sum on that inactive date column, try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Ftd_sum2:=
VAR md = MAX('Calendar'[date])
RETURN CALCULATE(
	SUM('TEST_'[Qty]),
	USERELATIONSHIP('Calendar'[Date],'TEST_'[Calculated]),
	ALL('Calendar'),
	'Calendar'[Date]&amp;lt;=md)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;If you need additional filters, apply them to the page or visual filters...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2024 15:41:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-CALCULATE-VAR-table-with-USERELATIONSHIP/m-p/4107234#M162989</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2024-08-19T15:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to CALCULATE VAR table with USERELATIONSHIP</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-CALCULATE-VAR-table-with-USERELATIONSHIP/m-p/4127729#M163929</link>
      <description>&lt;P&gt;I'm sorry for my late reply.Yes,your suggestion can success at most of cases.&lt;BR /&gt;the key point is it uses relationship between "calculated column" and calender.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;This might be related to following article,but I have no idea to do what I needed by using &amp;gt;LOOKUPVALUE.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/userelationship-in-calculated-columns/" target="_self" rel="nofollow noopener noreferrer"&gt;&amp;gt;USERELATIONSHIP in calculated column&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2024 04:47:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-CALCULATE-VAR-table-with-USERELATIONSHIP/m-p/4127729#M163929</guid>
      <dc:creator>ohnothimagain</dc:creator>
      <dc:date>2024-08-31T04:47:52Z</dc:date>
    </item>
  </channel>
</rss>

