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
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
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.
- Anonymous1 year agoNot applicable
Hi YagoXavier
I hope your issue got resolved, we’re closing this thread as of now. For any further discussions or questions, please start a new thread in the Microsoft Fabric Community Forum we’ll be happy to assist. Thank you for being part of the Microsoft Fabric Community.