<?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: Dynamically Reference a Measure within another Measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/3242354#M119334</link>
    <description>&lt;P&gt;It would be nice to be able to reference measures within another measure using dynamic text strings.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 May 2023 13:16:44 GMT</pubDate>
    <dc:creator>justinh</dc:creator>
    <dc:date>2023-05-18T13:16:44Z</dc:date>
    <item>
      <title>Dynamically Reference a Measure within another Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/1079170#M15185</link>
      <description>&lt;P&gt;Does anyone know if it is possible to reference a measure dynamically within another measure? As an example, you want to bring back a measure if it matches the formatted value of a slicer. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MasterTest = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR SelMeasure = SELECTEDVALUE('Measure Select'[Measure Select])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"["&amp;amp;SelMeasure&amp;amp;"]"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The above obviously does not work, but I wonder if there is an equivilent of the INDIRECT() excel function?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I know I can do this manually, listing every measure in a SWITCH or IF function, but I have found that these functions run very slowly, to a point that would be unacceptable to the user (each measure normally takes 3 seconds to run, but putting them in a SWITCH increases it to 80 seconds) so wanted to try and calculate without a SWITCH/IF function&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 07 May 2020 12:27:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/1079170#M15185</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-07T12:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Reference a Measure within another Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/1079179#M15186</link>
      <description>Yes, you can reference a measure in a measure like:&lt;BR /&gt;&lt;BR /&gt;Measure = [Another measure]&lt;BR /&gt;&lt;BR /&gt;VAR's are just their name&lt;BR /&gt;&lt;BR /&gt;VAR __MyVar = 1&lt;BR /&gt;RETURN __MyVar</description>
      <pubDate>Thu, 07 May 2020 12:30:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/1079179#M15186</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-05-07T12:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Reference a Measure within another Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/1079219#M15187</link>
      <description>&lt;P&gt;Thanks for the reply Greg. I may be that i'm not smart enough to understand your reply, but I can't see how i can make that dynamically reference multiple measures?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The VAR would still be static and referencing a single measure wouldnt it? I want the user to be able to choose multiple measures. The measures will then sit in the columns of a matrix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm essentially trying to achieve the solution to this post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Dynamic-Column-Names-for-Matrix-Visual-using-Sliced-Measures/td-p/790037" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/Dynamic-Column-Names-for-Matrix-Visual-using-Sliced-Measures/td-p/790037&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But without Switch/IF, given the slowdown they create.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help again!&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 12:44:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/1079219#M15187</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-07T12:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Reference a Measure within another Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/1079224#M15188</link>
      <description>&lt;P&gt;OK, that definitely clarifies things. You need a disconnected table I believe.&amp;nbsp;In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, see this:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/963588#M428" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/963588#M428&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And this:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-EVERYTHING-measures-axis-legend-titles-chart-types/m-p/1027881#M444" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-EVERYTHING-measures-axis-legend-titles-chart-types/m-p/1027881#M444&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 12:47:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/1079224#M15188</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-05-07T12:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Reference a Measure within another Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/1079249#M15189</link>
      <description>&lt;P&gt;Thanks again Greg. I think this is essentially what i've already done, but in those links you sent over, you still need to do an IF/SWITCH statement in the end to ultimately tie the measures together. I was looking at a way around this, and thought if it could dynamically reference a measure based on text, then i could skip using SWITCH altogether&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 12:59:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/1079249#M15189</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-07T12:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Reference a Measure within another Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/1080371#M15236</link>
      <description>&lt;P&gt;I don't think what you are describing is possible in DAX.&amp;nbsp; For example, if you could have a table of labels and DAX expressions as text, you could use the label column in your slicer and the "measure" would execute the DAX expression for that row.&amp;nbsp; That doesn't exist as far as I know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2020 01:48:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/1080371#M15236</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-05-08T01:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Reference a Measure within another Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/3242354#M119334</link>
      <description>&lt;P&gt;It would be nice to be able to reference measures within another measure using dynamic text strings.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 13:16:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/3242354#M119334</guid>
      <dc:creator>justinh</dc:creator>
      <dc:date>2023-05-18T13:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Reference a Measure within another Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/3717769#M144740</link>
      <description>&lt;P&gt;We want to do this as well.&amp;nbsp; Our use case involves storing report metadata in a dimension we call "Layouts".&amp;nbsp; The Layouts dimension defines how the rows of a report will look and behave.&amp;nbsp; There are Level 1 to 3 columns on this dimension for hierachy purposes, but we also have CalcType and Calc1 to 4 columns.&amp;nbsp; The CalcType dictate the behaviour of the measure based using DAX.&amp;nbsp; Here are examples of CalcType behaviour we are testing now:&lt;BR /&gt;&lt;BR /&gt;0 = Return Blank (for reports that need a blank row as a separator)&lt;BR /&gt;1 = Use foreign key listed for that row (e.g. Account Number)&lt;BR /&gt;2 = Use range of values&lt;BR /&gt;3 = Use measure (&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;this is where your solution would be helpful - &lt;/STRONG&gt;&lt;FONT color="#000000"&gt;we would essentially specify a measure in the Calc1 field.&lt;/FONT&gt;&lt;/FONT&gt;)&lt;BR /&gt;4 = Divide (E.g. sum two separate values for a level and divide them - this is great for getting things like % of Revenue at a row level)&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 16:47:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-Reference-a-Measure-within-another-Measure/m-p/3717769#M144740</guid>
      <dc:creator>jbauer22</dc:creator>
      <dc:date>2024-02-22T16:47:43Z</dc:date>
    </item>
  </channel>
</rss>

