Forum Discussion
Dynamic Measure and using her in one calculation
- 1 year ago
VahidDM 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.
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() )
However, I´m facing now a format problem, since I have Currency (R$) and quantity format, I will change my calcs as the following:Valores - Primeiro Ano = IF( MIN(Vendas[Ano]) = MAX(Vendas[Ano]), BLANK(), CALCULATE( [MedidaSelecionada], FILTER(Vendas, Vendas[Ano] = MIN(Vendas[Ano])) ) )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() )
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!
Thank you for ALL your help Vahid!
VahidDM Hello Vahid, I´m trying the solution proposed in this article's but I´ve not suceeded yet.
https://community.fabric.microsoft.com/t5/Desktop/Field-Parameters-Dynamic-Visual-Title/td-p/2529607
https://www.sqlbi.com/blog/marco/2022/06/11/using-selectedvalue-with-fields-parameters-in-power-bi/
Hard to find an workaround.