Forum Discussion

salimlko's avatar
salimlko
New Member
3 years ago

PERCENTAGE Related ISSUE

I have a unpivoted table in power BI like below having ads in column Q9 and ratings in Response column where 1 is least interested and 10 is very interested.
There are total 30 rows in my raw data set. Below is the screenshot of the first few rows of unpivoted table.

 

In this I want to find out top 5 AD methods for which respondents have selected 5,6,7,8,9 and 10 ratings along with percentage.

I created a table, and done settings to show top 5 rated ads as below.

 

 

However, if you will see the column "Count of Index", through that i tried to show it as "Percentof Grand Total" but it will not show the correct percentages because it will be calculated based on grand total sum 29 but the total records in my data set are 30 and one is not showing in the table because for that one, rating is not between 5-10.

 

 

 

How can I handle this situation and achieve my requirement.

Looking forward for your help here as I stuck at this point.

 

Thanks,

Salim

3 Replies

  • salimlko Please refer Below Code
    Count of Index =
    CALCULATE ( [Count Of Response], ALLSELECTED ( Table[Q9] ) )

    *********************************************************************
    Percentof Grand Total =
    DIVIDE ( [Count Of Response], [Count of Index], 0 )

    salimlko > Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Happy to help!!

     

    • salimlko's avatar
      salimlko
      New Member

      Hi Mahesh,

       

      Thanks for looking into my query but actually it's not working.

       

      I created below two measures as per your suggestion but it;s not working.

       

      Count of Index =
      CALCULATE ( count(Q9_Interest[Response]), ALLSELECTED ( Q9_Interest[Q9] ) )
      Percentof Grand Total =
      DIVIDE ( count(Q9_Interest[Response]), count(Q9_Interest[Index]), 0 )

       

      Below is the screenshot for your reference.

       

       

      Thanks,

      Salim

      • Mahesh0016's avatar
        Mahesh0016
        Icon for Super User rankSuper User

        salimlko please Format this measure As Percentage [Percentof Grand Total ] .

         

        salimlko Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Happy to help!!