Forum Discussion

aleon's avatar
aleon
Frequent Visitor
8 years ago
Solved

percentage

Hello,

 

On power bi I have a table with a percentage column, and on the total, in stead of show the percentage of the total, power bi sums all the percentages:

How can I solve it?

 

Thank you!

  • aleon : As per my understanding you are trying to find % of REPO S over total (REPO S + REPO N)

     

    If yes, do the following

    1. Do not create a column
    2. Just write the following measure and add it to your table

    REPO S % =
    SUM ( CustomerData[REPO S] )
    / ( SUM ( CustomerData[REPO S] ) + SUM ( CustomerData[REPO N] ) )

     

     

    Here is the snapshot of the result


     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    You can download excel powerpivot file here

     

    thanks

4 Replies

  • How are the percentages calculated? If they are calculated outside of Power BI, for example as a field in a database query rather than via DAX, they may need to be set to Summarize as Average instead of Sum.

    • aleon's avatar
      aleon
      Frequent Visitor

      They are calculated on power bi, I have added a new column to the table with the next formula:

      REPO_S_PERCENTATGE = DIVIDE(customer_data[REPO_S];customer_data[REPO_S]+customer_data[REPO_N];0)

      • ChandeepChhabra's avatar
        ChandeepChhabra
        Impactful Individual

        aleon : As per my understanding you are trying to find % of REPO S over total (REPO S + REPO N)

         

        If yes, do the following

        1. Do not create a column
        2. Just write the following measure and add it to your table

        REPO S % =
        SUM ( CustomerData[REPO S] )
        / ( SUM ( CustomerData[REPO S] ) + SUM ( CustomerData[REPO N] ) )

         

         

        Here is the snapshot of the result


         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

        You can download excel powerpivot file here

         

        thanks