Forum Discussion

ERing's avatar
ERing
Post Partisan
1 year ago
Solved

Format String to remove decimal places?

I was recently provided a solution here to allow for grouped headers in my matrix visual. The solution uses a disconnected table with a Format String column and a SWITCH. The measure format properties is set to dynamic.

I would like to display my currency rounded to the nearest dollar ($.49 and below rounds down, $.50 and above rounds up). 

Is it possible to accomplish this with my report is set up?









  • ERing 

     

    you need to select the dynamic and add DAX coding


    SWITCH(
        SELECTEDVALUE('Table'[type]),
        "actual","0.0",
        "py","0"
        )
     

  • This is from your previous sample file, and you can see that the format strings are applied correctly. So, it’s likely that something in your current file—such as settings or other factors—is preventing the format strings from being applied properly.

     

7 Replies

  • Hi ERing 

     

    The $#,# format in your screenshot should already be rounding the numbers up or down as described.

     

     

     

    • ERing's avatar
      ERing
      Post Partisan

      Hi danextian

      I'm not following. You're saying the $#,# format string should already be rounding the numbers, but you can see from the screen capture of my report that two decimal places are showing.

       




      • danextian's avatar
        danextian
        Super User


        This is from your previous sample file, and you can see that the format strings are applied correctly. So, it’s likely that something in your current file—such as settings or other factors—is preventing the format strings from being applied properly.

         

  • ERing 

     

    you need to select the dynamic and add DAX coding


    SWITCH(
        SELECTEDVALUE('Table'[type]),
        "actual","0.0",
        "py","0"
        )
     
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ERing,

     

    Also, thanks to danextian  and ryan_mayu   for the prompt and helpful responses.

     

    we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.

    If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

     

    Regards,

    Prasanna Kumar

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ERing,

    We wanted to kindly check in to see if everything is working as expected after trying the suggested solution. If there’s anything else we can assist with, please don’t hesitate to ask.

    If the issue is resolved, we’d appreciate it if you could mark the helpful reply as Accepted Solution — it helps others who might face a similar issue.

     

    Warm regards,

    Prasanna Kumar

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ERing,

     

    Just a gentle reminder — has your issue been resolved? If so, we’d be grateful if you could mark the solution that worked as Accepted Solution, or feel free to share your own if you found a different fix.

    This not only closes the loop on your query but also helps others in the community solve similar issues faster.

    Thank you for your time and feedback!

     

    Best,

    Prasanna Kumar