Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi guys,
I have used a switch function to create the following table:
The switch function I have used is the next one:
Solved! Go to Solution.
@PwrBI01 ,
Create a meaure with the below DAX:
MEASURE = IF(HASONEVALUE('T_M_Tabla indicadores económicos'[Medida]);SWITCH(VALUES('T_M_Tabla indicadores económicos'[Medida]);"Variación prev. año";FORMAT([Acumulado dos años previos],"#.### $");"% crecimiento";FORMAT([Acumulado var %],"Percent");"Importe medio";FORMAT([Switch importe medio],"## $");"% Var importe medio";FORMAT([Switch importe medio % var],"Percent");"Variación a fecha";FORMAT([Acumulado var],"#.### $")))
P.S. Just replace the $ sign with Pound sign while writing this dax as per your currency requirement.
@PwrBI01 ,
Create a meaure with the below DAX:
MEASURE = IF(HASONEVALUE('T_M_Tabla indicadores económicos'[Medida]);SWITCH(VALUES('T_M_Tabla indicadores económicos'[Medida]);"Variación prev. año";FORMAT([Acumulado dos años previos],"#.### $");"% crecimiento";FORMAT([Acumulado var %],"Percent");"Importe medio";FORMAT([Switch importe medio],"## $");"% Var importe medio";FORMAT([Switch importe medio % var],"Percent");"Variación a fecha";FORMAT([Acumulado var],"#.### $")))
P.S. Just replace the $ sign with Pound sign while writing this dax as per your currency requirement.
Thank you very much @Tahreem24,
I made some changes (for no decimals in percentages and for get the local format) and it works. The measure I finally used is the next one:
@PwrBI01 Great!
Yeah, I just shared the possible workaround using Format DAX. It's nice that you changed it accordingly to your needs.
@PwrBI01 , You have to use calculation groups for that as of now
https://www.sqlbi.com/blog/marco/2020/07/15/creating-calculation-groups-in-power-bi-desktop/
Thank you very much for your answer @amitchandak but I would like to do it in a more easy way.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 63 | |
| 53 | |
| 42 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 123 | |
| 105 | |
| 45 | |
| 32 | |
| 24 |