<?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 Dynamic Measure and using her in one calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4331467#M171958</link>
    <description>&lt;P&gt;I have the following Table, with a Dynamic Parameter that changes the measure used in graphs:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Dimensão de Valores = {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN&gt;"Valor de Venda"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;NAMEOF&lt;/SPAN&gt;&lt;SPAN&gt;([Valor Total de Venda]), &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN&gt;"Quantidade (PE)"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;NAMEOF&lt;/SPAN&gt;&lt;SPAN&gt;([Total Quantidade (PE)]), &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN&gt;"Quantidade"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;NAMEOF&lt;/SPAN&gt;&lt;SPAN&gt;([Total Quantidade]), &lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN&gt;"Peso Bruto"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;NAMEOF&lt;/SPAN&gt;&lt;SPAN&gt;([Total Peso Bruto]), &lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN&gt;"Peso Líquido"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;NAMEOF&lt;/SPAN&gt;&lt;SPAN&gt;([Total Peso Líquido]), &lt;/SPAN&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;All of the "TOTAL" are SUM() measures.&lt;BR /&gt;&lt;BR /&gt;However "Dimensão de Valores"&amp;nbsp; returns me and String value, in face of this I´m facing two problems:&lt;BR /&gt;1) When using it, it doesn´t order descending/ascending automatically, when we change the parameter, we need to click in the datatable to proper order;&lt;BR /&gt;2) I have an calculation that needs to be changed as it change the parameter but i´m not finding a proper solution for this:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Vendas&lt;/SPAN&gt;&lt;SPAN&gt;[Ano]&lt;/SPAN&gt;&lt;SPAN&gt;)=&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Vendas&lt;/SPAN&gt;&lt;SPAN&gt;[Ano]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Movimentos&lt;/SPAN&gt;&lt;SPAN&gt;[Valor de Venda]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Vendas&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Vendas&lt;/SPAN&gt;&lt;SPAN&gt;[Ano]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Vendas&lt;/SPAN&gt;&lt;SPAN&gt;[Ano]&lt;/SPAN&gt;&lt;SPAN&gt;))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 16 Dec 2024 19:59:11 GMT</pubDate>
    <dc:creator>brunozanoelo</dc:creator>
    <dc:date>2024-12-16T19:59:11Z</dc:date>
    <item>
      <title>Dynamic Measure and using her in one calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4331467#M171958</link>
      <description>&lt;P&gt;I have the following Table, with a Dynamic Parameter that changes the measure used in graphs:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Dimensão de Valores = {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN&gt;"Valor de Venda"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;NAMEOF&lt;/SPAN&gt;&lt;SPAN&gt;([Valor Total de Venda]), &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN&gt;"Quantidade (PE)"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;NAMEOF&lt;/SPAN&gt;&lt;SPAN&gt;([Total Quantidade (PE)]), &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN&gt;"Quantidade"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;NAMEOF&lt;/SPAN&gt;&lt;SPAN&gt;([Total Quantidade]), &lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN&gt;"Peso Bruto"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;NAMEOF&lt;/SPAN&gt;&lt;SPAN&gt;([Total Peso Bruto]), &lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (&lt;/SPAN&gt;&lt;SPAN&gt;"Peso Líquido"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;NAMEOF&lt;/SPAN&gt;&lt;SPAN&gt;([Total Peso Líquido]), &lt;/SPAN&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;All of the "TOTAL" are SUM() measures.&lt;BR /&gt;&lt;BR /&gt;However "Dimensão de Valores"&amp;nbsp; returns me and String value, in face of this I´m facing two problems:&lt;BR /&gt;1) When using it, it doesn´t order descending/ascending automatically, when we change the parameter, we need to click in the datatable to proper order;&lt;BR /&gt;2) I have an calculation that needs to be changed as it change the parameter but i´m not finding a proper solution for this:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Vendas&lt;/SPAN&gt;&lt;SPAN&gt;[Ano]&lt;/SPAN&gt;&lt;SPAN&gt;)=&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Vendas&lt;/SPAN&gt;&lt;SPAN&gt;[Ano]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Movimentos&lt;/SPAN&gt;&lt;SPAN&gt;[Valor de Venda]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Vendas&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Vendas&lt;/SPAN&gt;&lt;SPAN&gt;[Ano]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Vendas&lt;/SPAN&gt;&lt;SPAN&gt;[Ano]&lt;/SPAN&gt;&lt;SPAN&gt;))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Dec 2024 19:59:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4331467#M171958</guid>
      <dc:creator>brunozanoelo</dc:creator>
      <dc:date>2024-12-16T19:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Measure and using her in one calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4331967#M171982</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13974" data-lia-user-login="brunozanoelo" class="lia-mention lia-mention-user"&gt;brunozanoelo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Short Answer:&lt;/STRONG&gt;&lt;BR /&gt;Use a SWITCH function to map the selected text value to the corresponding measure, and then reference that measure in your calculations. For sorting, consider using a numeric column in the parameter table or field parameters for dynamic sorting.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Detailed Steps:&lt;/STRONG&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Map the Selected Parameter to a Measure:&lt;/STRONG&gt;&lt;BR /&gt;Instead of returning a string measure name, use a SWITCH in a measure to choose the corresponding numeric measure. For example:&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;LI-CODE lang="markup"&gt;SelectedMeasureValue =
SWITCH(
    SELECTEDVALUE('Dimensão de Valores'[Dimensão de Valores]),
    "Valor de Venda", [Valor Total de Venda],
    "Quantidade (PE)", [Total Quantidade (PE)],
    "Quantidade", [Total Quantidade],
    "Peso Bruto", [Total Peso Bruto],
    "Peso Líquido", [Total Peso Líquido],
    BLANK()
)
&lt;/LI-CODE&gt;
&lt;P&gt;Now SelectedMeasureValue returns the actual numeric measure, not text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Use the Mapped Measure in Calculations:&lt;/STRONG&gt; Your existing calculation:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IF(
    MIN(Vendas[Ano]) = MAX(Vendas[Ano]),
    BLANK(),
    CALCULATE(
        SUM(Movimentos[Valor de Venda]),
        FILTER(Vendas, Vendas[Ano] = MIN(Vendas[Ano]))
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Replace SUM(Movimentos[Valor de Venda]) with your new SelectedMeasureValue:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DynamicCalculation =
IF(
    MIN(Vendas[Ano]) = MAX(Vendas[Ano]),
    BLANK(),
    CALCULATE(
        [SelectedMeasureValue],
        FILTER(Vendas, Vendas[Ano] = MIN(Vendas[Ano]))
    )
)
&lt;/LI-CODE&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Handle Sorting:&lt;/STRONG&gt; For sorting issues:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Ensure your visuals are set to sort by this measure or by the corresponding numeric column.&lt;/LI&gt;
&lt;LI&gt;If you need dynamic sorting based on the parameter, consider:
&lt;UL&gt;
&lt;LI&gt;Adding a numeric column to the parameter table and sorting by that column.&lt;/LI&gt;
&lt;LI&gt;Using field parameters (if available) for more flexible sorting scenarios.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;By using a SWITCH measure, you dynamically select the appropriate measure based on the parameter selection, enabling both correct aggregation and easier control over sorting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;STRONG&gt; helps&lt;/STRONG&gt;, please consider &lt;STRONG&gt;accepting&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank" rel="noopener noreferrer"&gt;LinkedIn&lt;/A&gt;|&lt;A href="https://twitter.com/VahidDMcom" target="_blank" rel="noopener noreferrer"&gt;Twitter&lt;/A&gt;|&lt;A href="https://www.vahiddm.com/" target="_blank" rel="noopener noreferrer"&gt;Blog&amp;nbsp;&lt;/A&gt;|&lt;A href="https://www.youtube.com/@databis" target="_blank" rel="noopener noreferrer"&gt;YouTube&lt;/A&gt;&lt;A href="https://www.youtube.com/@databis" target="_blank" rel="noopener noreferrer"&gt;&amp;nbsp;&lt;/A&gt;&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;</description>
      <pubDate>Tue, 17 Dec 2024 02:47:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4331967#M171982</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2024-12-17T02:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Measure and using her in one calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4332961#M172021</link>
      <description>&lt;P&gt;Hello &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;&amp;nbsp;! It´s a pleasure to meet you, thank you for your help.&lt;BR /&gt;&lt;BR /&gt;I tried the following solution and appears to work, until the part of the calculation, PowerBI Desktop gives me this error on visuals:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Error fetching data for this visual:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;MdxScript(Model) (195, 5) Calculation error in the measure "Dimensão de Valores"[SelectedMeasureValue]: A [Values] is part of the composite column key, but not all columns in the composite key are included in the expression or its dependent expression.&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Any suggestion?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 13:05:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4332961#M172021</guid>
      <dc:creator>brunozanoelo</dc:creator>
      <dc:date>2024-12-17T13:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Measure and using her in one calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4333102#M172033</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 13:05:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4333102#M172033</guid>
      <dc:creator>brunozanoelo</dc:creator>
      <dc:date>2024-12-17T13:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Measure and using her in one calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4335129#M172126</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;&amp;nbsp;Hello Vahid, I´m trying the solution proposed in this article's but I´ve not suceeded yet.&lt;BR /&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Field-Parameters-Dynamic-Visual-Title/td-p/2529607" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/Field-Parameters-Dynamic-Visual-Title/td-p/2529607&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/blog/marco/2022/06/11/using-selectedvalue-with-fields-parameters-in-power-bi/" target="_blank"&gt;https://www.sqlbi.com/blog/marco/2022/06/11/using-selectedvalue-with-fields-parameters-in-power-bi/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hard to find an workaround.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 13:17:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4335129#M172126</guid>
      <dc:creator>brunozanoelo</dc:creator>
      <dc:date>2024-12-18T13:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Measure and using her in one calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4335245#M172139</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;&amp;nbsp;Hello Vahid, I´ve found one solution, using the integer field of my table and not the string one, in this case, PowerBI seens to understand the key.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MedidaSelecionada = 
SWITCH(
    SELECTEDVALUE('Dimensão de Valores'[Parâmetro Pedido]),
    0, [Valor Total de Venda],
    1, [Total Quantidade (PE)],
    2, [Total Quantidade],
    3, [Total Peso Bruto],
    4, [Total Peso Líquido],
    BLANK()
)​&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;However, I´m facing now a format problem, since I have Currency (R$) and quantity format, I will change my calcs as the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Valores - Primeiro Ano = IF(
    MIN(Vendas[Ano]) = MAX(Vendas[Ano]),
    BLANK(),
    CALCULATE(
        [MedidaSelecionada],
        FILTER(Vendas, Vendas[Ano] = MIN(Vendas[Ano]))
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Valores - Primeiro Ano (Formatado) = 
 SWITCH(
    SELECTEDVALUE('Dimensão de Valores'[Parâmetro Pedido]),
    0, FORMAT([Valores - Primeiro Ano], "R$ #,##00.00"),
    1, FORMAT([Valores - Primeiro Ano], "Standard"),
    2, FORMAT([Valores - Primeiro Ano], "Standard"),
    3, FORMAT([Valores - Primeiro Ano], "Standard"),
    4, FORMAT([Valores - Primeiro Ano], "Standard"),
    BLANK()
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;It appears to be working fine, in many calculations, however the Format is still and issue that doesn´t get automatically from the field configurations, I need to do it manually in each one of my calcs!&lt;BR /&gt;&lt;BR /&gt;Thank you for ALL your help Vahid!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 14:22:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4335245#M172139</guid>
      <dc:creator>brunozanoelo</dc:creator>
      <dc:date>2024-12-18T14:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Measure and using her in one calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4336589#M172192</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13974" data-lia-user-login="brunozanoelo" class="lia-mention lia-mention-user"&gt;brunozanoelo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from&amp;nbsp;VahidDM&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;brunozanoelo, good to know that you have solved the previous problem, for the problem you are facing now, if I understand correctly, do you need to make the data automatically into the corresponding format based on the Field parameter's options? I can't reproduce your scenario with the information so far, could you please provide some sample data and the expected results based on the sample data?&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Power-BI-Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;How to provide sample data in the Power BI Forum - Microsoft Fabric Community&lt;/A&gt;&amp;nbsp;Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yulia Xu&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 09:17:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Measure-and-using-her-in-one-calculation/m-p/4336589#M172192</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-19T09:17:15Z</dc:date>
    </item>
  </channel>
</rss>

