<?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: Apply a DAX expression stored in a table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-a-DAX-expression-stored-in-a-table/m-p/3054614#M105324</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN&gt;Aniya for your feedback.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It's clear now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cillian&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Feb 2023 08:20:07 GMT</pubDate>
    <dc:creator>Fgcillian</dc:creator>
    <dc:date>2023-02-01T08:20:07Z</dc:date>
    <item>
      <title>Apply a DAX expression stored in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-a-DAX-expression-stored-in-a-table/m-p/3040037#M104222</link>
      <description>&lt;P&gt;I'm struggling with an requirement and I don't really know if it can be done in Power BI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Requirements:&lt;/STRONG&gt; 1)DAX expressions will be stored in a column within a table imported in the data model of PBI.&lt;BR /&gt;2) Dinamically a Mesaure within Power BI should take the DAX expresion stored and apply it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attach a small example of what I´m trying to do.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;From Data table (Data):&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Customer&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CLIENT1&lt;/TD&gt;&lt;TD&gt;145&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CLIENT1&lt;/TD&gt;&lt;TD&gt;54&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CLIENT1&lt;/TD&gt;&lt;TD&gt;777&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CLIENT1&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CLIENT1&lt;/TD&gt;&lt;TD&gt;55&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CLIENT1&lt;/TD&gt;&lt;TD&gt;888&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CLIENT1&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I need to apply the DAX expression stored in the following table (Expression):&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Customer&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Expression&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CLIENT 1&lt;/TD&gt;&lt;TD&gt;MAX(Data[Data])&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For that, I'm creating a Measure that applies the expression using the CALCULATE function:&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;EM&gt;MAX_FROM_TABLE = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;EM&gt;VAR _evalExpression = (ALL( 'EXPRESSIONS'[Expression] ))&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;EM&gt;RETURN&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;EM&gt;CALCULATE(_evalExpression)&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculate returns the stored DAX but do not applies the formula:&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Is this possible with DAX? Which expression should I use?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated thanks.&lt;BR /&gt;Greetings from Spain.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 11:45:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-a-DAX-expression-stored-in-a-table/m-p/3040037#M104222</guid>
      <dc:creator>Fgcillian</dc:creator>
      <dc:date>2023-01-24T11:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a DAX expression stored in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-a-DAX-expression-stored-in-a-table/m-p/3041634#M104359</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="503127" data-lia-user-login="Fgcillian" class="lia-mention lia-mention-user"&gt;Fgcillian&lt;/a&gt; , Try like &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;calculate(MAX(Data[Data]), all())&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 02:24:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-a-DAX-expression-stored-in-a-table/m-p/3041634#M104359</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-01-25T02:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a DAX expression stored in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-a-DAX-expression-stored-in-a-table/m-p/3044141#M104584</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="503127" data-lia-user-login="Fgcillian" class="lia-mention lia-mention-user"&gt;Fgcillian&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, you want to put a DAX expression in a table and then use a function to call the field.&lt;/P&gt;
&lt;P&gt;According to my research, this is currently not possible in Power BI, and there is currently no function in the DAX function that can call text text to run expressions.&lt;/P&gt;
&lt;P&gt;For your stored "MAX(Data[Data])", stored in Power BI is just a normal string format, so whatever formula is used, a string literal is returned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With Measure, what is stored is really just a formula, which is only calculated when it needs to be calculated. For your different needs, you can try to create multiple measures or use some conditional judgment functions to meet your different needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 02:26:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-a-DAX-expression-stored-in-a-table/m-p/3044141#M104584</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2023-01-26T02:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Apply a DAX expression stored in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-a-DAX-expression-stored-in-a-table/m-p/3054614#M105324</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN&gt;Aniya for your feedback.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It's clear now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cillian&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 08:20:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Apply-a-DAX-expression-stored-in-a-table/m-p/3054614#M105324</guid>
      <dc:creator>Fgcillian</dc:creator>
      <dc:date>2023-02-01T08:20:07Z</dc:date>
    </item>
  </channel>
</rss>

