Forum Discussion

supervkc's avatar
supervkc
New Member
9 years ago
Solved

Percentage with Count Quantity

New user to Power BI here, and I am trying to calculate the percentage of each count of Qty from the total quantity count.

 

I am missing something in my formula, and my percentages are off.

 

I need to calculate 458/572, 92/572 and 22/572.

 

 

Any help is much appreciated.

  • Hi supervkc,

     

    In your scenario, you can create a measure with the DAX like below:

     

    % = DIVIDE(COUNT('18'[Qty]),CALCULATE(COUNT('18'[Qty]),ALL('18')),0)

     

    Assume the sample data like this:

     

     

    Best Regards,
    Qiuyun Yu

     

     

     

     

  • Thiyags's avatar
    Thiyags
    9 years ago

    Hi,

     

    There is another easy way to do it.  Right click the metric or measure. Click Quik calc. In the dialog box, choose percentage of grand total.

     

2 Replies

  • v-qiuyu-msft's avatar
    v-qiuyu-msft
    Community Support

    Hi supervkc,

     

    In your scenario, you can create a measure with the DAX like below:

     

    % = DIVIDE(COUNT('18'[Qty]),CALCULATE(COUNT('18'[Qty]),ALL('18')),0)

     

    Assume the sample data like this:

     

     

    Best Regards,
    Qiuyun Yu

     

     

     

     

    • Thiyags's avatar
      Thiyags
      Helper II

      Hi,

       

      There is another easy way to do it.  Right click the metric or measure. Click Quik calc. In the dialog box, choose percentage of grand total.