<?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 apply Measure in Dax Studio in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-apply-Measure-in-Dax-Studio/m-p/3245771#M119577</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please try something like below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DEFINE
    MEASURE Sales[sale_amount] =
        SUMX ( Sales, Sales[Qualtity] * Sales[Net Price] )
    VAR temp =
        SUMMARIZECOLUMNS ( Customer[Country], "Sales Amount1", Sales[sale_amount] )

EVALUATE
ADDCOLUMNS (
    temp,
    "rankx", RANKX ( VALUES ( Customer[Country] ), Sales[sale_amount] )
)&lt;/LI-CODE&gt;</description>
    <pubDate>Sun, 21 May 2023 05:55:21 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2023-05-21T05:55:21Z</dc:date>
    <item>
      <title>How to apply Measure in Dax Studio</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-apply-Measure-in-Dax-Studio/m-p/3245760#M119575</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to add a rank column for virtual table created by Dax function, my code as below&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DEFINE
	MEASURE Sales[sale_amount] = sumx(Sales, Sales[Quantity] * Sales[Net Price])
	

	var temp = SUMMARIZECOLUMNS (
	    Customer[Country],
	    "Sales Amount1",Sales[sale_amount]
	
		)
EVALUATE
	ADDCOLUMNS(temp, "rankx",rankx(
	    		Customer[Country],
	    		Sales[sale_amount]
			)
		)&lt;/LI-CODE&gt;&lt;P&gt;I got the error say "Table variable name 'temp' can not be used in the current context because a base table is expected" , this mean Rankx function can not work with virtual&amp;nbsp; table created by Dax code ??&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset used in the lab from this link &lt;A href="https://www.youtube.com/watch?v=pM_8zsPidRk" target="_self"&gt;Introducing RANKX in DAX&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2023 04:45:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-apply-Measure-in-Dax-Studio/m-p/3245760#M119575</guid>
      <dc:creator>thangmcsa</dc:creator>
      <dc:date>2023-05-21T04:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply Measure in Dax Studio</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-apply-Measure-in-Dax-Studio/m-p/3245771#M119577</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please try something like below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DEFINE
    MEASURE Sales[sale_amount] =
        SUMX ( Sales, Sales[Qualtity] * Sales[Net Price] )
    VAR temp =
        SUMMARIZECOLUMNS ( Customer[Country], "Sales Amount1", Sales[sale_amount] )

EVALUATE
ADDCOLUMNS (
    temp,
    "rankx", RANKX ( VALUES ( Customer[Country] ), Sales[sale_amount] )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 21 May 2023 05:55:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-apply-Measure-in-Dax-Studio/m-p/3245771#M119577</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-05-21T05:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply Measure in Dax Studio</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-apply-Measure-in-Dax-Studio/m-p/3245835#M119583</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The code provided work as well, however could you please help clarify why we can not use the code below ?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"rankx", RANKX ( VALUES ( temp[Country] ), temp[Sales Amount1] )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2023 08:10:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-apply-Measure-in-Dax-Studio/m-p/3245835#M119583</guid>
      <dc:creator>thangmcsa</dc:creator>
      <dc:date>2023-05-21T08:10:08Z</dc:date>
    </item>
  </channel>
</rss>

