Forum Discussion
Help with formatting measure(Swicth) with conditional based on selected parameter in power bi
- Anonymous1 year ago
Hi YagoXavier
Thank you for using Microsoft Community Forum.
The issue you're experiencing is due to how the FORMAT() function works in DAX. While FORMAT() can apply specific numeric formats like currency or decimal places, it converts the result into a text data type. This means visuals like bar and column charts, which require numeric values for rendering and aggregations (e.g., tooltips, data labels), cannot interpret the formatted output correctly, leading to visuals disappearing or behaving unexpectedly.
To dynamically apply formatting based on the selected comparison parameter without converting your measure to text, we recommend using Calculation Groups via Tabular Editor. Calculation Groups allow you to define both the expression and the numeric format string separately, preserving the numeric data type while enabling the desired formatting (such as currency, whole number, or decimal) depending on the user’s slicer selection. This approach resolves the formatting limitation cleanly and is the officially supported method for dynamic formatting in Power BI.
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Hi YagoXavier
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi YagoXavier
Thank you for being part of the Microsoft Fabric Community.