<?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: Use measure in filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-measure-in-filter/m-p/974800#M11726</link>
    <description>&lt;LI-CODE lang="markup"&gt;[Total Amount] = SUM ( ProdUnitAnalyzeScorecardView[Amount] )


[Your Measure] = 
var __sortOrderPeriod = [Var Sort order period]
var __numerator =
	CALCULATE (
	    [Total Amount],
	    ProdUnitAnalyzeScorecardView[Account] = "SCEBIT",
	    ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod] = __sortOrderPeriod
	)
var __denominator =
    CALCULATE (
        [Total Amount],
        ProdUnitAnalyzeScorecardView[Account] = "SC50",
        ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod] = __sortOrderPeriod
    )
var __result = DIVIDE( __numerator, __denominator )
RETURN
	__result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know anything about your model but I'd warn you against slicing directly on your fact table by the users. This is dangerous and may produce incorrect results you'll not even be aware of (since the great majority of people do not check their figures well against the source data). If you want to know why you should not do it, then you can search for an article on &lt;A href="http://www.sqlbi.com" target="_blank"&gt;www.sqlbi.com&lt;/A&gt;; just type in the search box: auto-exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
    <pubDate>Sun, 15 Mar 2020 13:49:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-15T13:49:30Z</dc:date>
    <item>
      <title>Use measure in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-measure-in-filter/m-p/974755#M11720</link>
      <description>&lt;P&gt;Hi need to include a measure into a filter to get dynamic calculations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have started to select the period with a slicer which gives my the period in a measure as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Var Sort order period = SELECTEDVALUE(ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;In this example i choose "202002 Actual" in Var Sort order Period. &amp;nbsp;&lt;/P&gt;&lt;P&gt;Then i would like to get the period value from&amp;nbsp; the measure "Var Sort order period"&lt;/P&gt;&lt;P&gt;Into the calculation below&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(SUM(ProdUnitAnalyzeScorecardView[Amount]);(ProdUnitAnalyzeScorecardView[Account]="SCEBIT");(ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod]=[Var Sort order period]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(SUM(ProdUnitAnalyzeScorecardView[Amount]);(ProdUnitAnalyzeScorecardView[Account]="SC50");(ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod]= [Var Sort order period]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which is not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i typer in the period "202002 actual" in the measure below it works. but i need to change the period from a slicer to get the diagram to react quickly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(SUM(ProdUnitAnalyzeScorecardView[Amount]);(ProdUnitAnalyzeScorecardView[Account]="SCEBIT");(ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod]="202002 Actual"))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(SUM(ProdUnitAnalyzeScorecardView[Amount]);(ProdUnitAnalyzeScorecardView[Account]="SC50");(ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod]="202002 Actual"))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any solution on how to do this?&lt;/P&gt;&lt;P&gt;Br&lt;/P&gt;&lt;P&gt;Arne&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="ics-element-donot-delete 1001_CC@"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 10:24:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-measure-in-filter/m-p/974755#M11720</guid>
      <dc:creator>Arne</dc:creator>
      <dc:date>2020-03-15T10:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Use measure in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-measure-in-filter/m-p/974800#M11726</link>
      <description>&lt;LI-CODE lang="markup"&gt;[Total Amount] = SUM ( ProdUnitAnalyzeScorecardView[Amount] )


[Your Measure] = 
var __sortOrderPeriod = [Var Sort order period]
var __numerator =
	CALCULATE (
	    [Total Amount],
	    ProdUnitAnalyzeScorecardView[Account] = "SCEBIT",
	    ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod] = __sortOrderPeriod
	)
var __denominator =
    CALCULATE (
        [Total Amount],
        ProdUnitAnalyzeScorecardView[Account] = "SC50",
        ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod] = __sortOrderPeriod
    )
var __result = DIVIDE( __numerator, __denominator )
RETURN
	__result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know anything about your model but I'd warn you against slicing directly on your fact table by the users. This is dangerous and may produce incorrect results you'll not even be aware of (since the great majority of people do not check their figures well against the source data). If you want to know why you should not do it, then you can search for an article on &lt;A href="http://www.sqlbi.com" target="_blank"&gt;www.sqlbi.com&lt;/A&gt;; just type in the search box: auto-exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 13:49:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-measure-in-filter/m-p/974800#M11726</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-15T13:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Use measure in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-measure-in-filter/m-p/974805#M11727</link>
      <description>&lt;P&gt;Not following this.&amp;nbsp;Please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 13:54:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-measure-in-filter/m-p/974805#M11727</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-15T13:54:55Z</dc:date>
    </item>
  </channel>
</rss>

