Forum Discussion

Justas4478's avatar
Justas4478
Icon for Post Prodigy rankPost Prodigy
1 year ago
Solved

Visual calculation dispalay as a %

Hi, I tried to use visual calculation for the first time.
To calculate percentage of a parent.
The problem I have is that displayed value is 1 or 0.94 and similar where I would want value dispalyed as 100% or 94%

 

  • daircom's avatar
    daircom
    1 year ago

    Justas4478  Ah yes then you need to use "0.0%" instead of "Percent"

     

    Percent of parent = FORMAT(DIVIDE([Sum of Column1], COLLAPSE([Sum of sum], ROWS)), "0.0%")

5 Replies

  • Hi Justas4478 ,

    If you want to show percentages as “94%” or “94.2%” (instead of 0.94), here’s what you can do:


    1. Use the FORMAT function:
    If you’re building your measure with DAX, wrap it like this to control the appearance: Percent of parent = FORMAT(DIVIDE([Sum of Column1], COLLAPSE([Sum of sum], ROWS)), "0.0%")

    2. (Better option) Keep your measure numeric and use Power BI’s modeling tools: Write your DAX measure as a regular number (don’t use FORMAT).  In Model view, select the measure, set the format to “Percentage” and choose the decimal places you want. This way, you get correct sorting, summaries, and visuals.

    Using FORMAT makes the result text, which is fine for visuals but not great for calculations or sorting. If you want full flexibility.

    • Justas4478's avatar
      Justas4478
      Icon for Post Prodigy rankPost Prodigy

      rohit1991 I can't do that unfortunatelly since 

        does not create actual mesure or calculated column that you can select and format.

  • Hi Justas4478 ,There is no easy "click and play" solution to this yet. So you have to use DAX to do this. You can achieve what you want by using the FORMAT function like below to get a percentage

    For example:

    Percent of parent = FORMAT(DIVIDE([Sum of Value1], COLLAPSE([Sum of Value2], ROWS)), "Percent") 

     

     

     

    • Justas4478's avatar
      Justas4478
      Icon for Post Prodigy rankPost Prodigy

      daircom It works.
      I tried to do decimal places format to 1 decimal space, but it does't work for some reason.
      Can decimal formating then be added to this formula in some way?

      • daircom's avatar
        daircom
        Icon for Resolver II rankResolver II

        Justas4478  Ah yes then you need to use "0.0%" instead of "Percent"

         

        Percent of parent = FORMAT(DIVIDE([Sum of Column1], COLLAPSE([Sum of sum], ROWS)), "0.0%")