Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Help with % by category

Hello,

I need to visualize the percentage of status for each document.

I have an measure but it's not showing all the status %

% Status = 
    DIVIDE(CALCULATE(DISTINCTCOUNT('Planilha1'[Documento_de_compras]), 'Planilha1'[Aderencia na Cadeia]="ADERENTE"),
        CALCULATE(DISTINCTCOUNT('Planilha1'[Documento_de_compras]))
    )

 

 

In the Pbix example I have 14 documents, 9 with status "ADERENTE", 3 with status "NÃO ADERENTE", 2 blank.
I need to see the correct % in the graphic excluding blankrow, so the correct for the Customer 7899 in August is:
75% "ADERENTE" and 25% "NÃO ADERENTE"

But my measure showing 100% "ADERENTE" and 300% "NÃO ADERENTE"

 Pbix file:

https://1drv.ms/u/s!Avq1zGJizBimsUCECKbCmKD7UL7g?e=yZmBqc​

 

 

Thanks for all.

 

Regards,

Denis.

  • Hi,

    Sorry I don't think I understand 100%. I cannot get the number, that you provided, by pbix file. 

    I assume you are asking about the below?

    Please check the below picture and the attached pbix file.

     

     

5 Replies

  • Hi,

    I am not sure if I undeststood your question correctly, but please check the below picture and the attached pbix file.

     

     

     

    % Status =
    DIVIDE (
        CALCULATE (
            DISTINCTCOUNT ( 'Planilha1'[Documento_de_compras] ),
            'Planilha1'[Aderencia na Cadeia]
                = SELECTEDVALUE ( Planilha1[Aderencia na Cadeia] ),
            ALLSELECTED ( Planilha1 )
        ),
        CALCULATE (
            DISTINCTCOUNT ( 'Planilha1'[Documento_de_compras] ),
            ALLSELECTED ( Planilha1 )
        )
    )
    
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Jihwan_Kim ,

       

      Thanks for your help.

       

      But unfortunately it was not what I expected. Trying to explain it better what I need is really the total percentage of the categories over the months.

       

      In excel through pivot table I get what I need, a percentage of my 2 categories. I needed to reproduce in Power BI, but the DIVIDE measure with my parameters is not working well.

       

      PBI:

       


      Excel:

       

       

      I save the excel file example on same folder:
      https://1drv.ms/u/s!Avq1zGJizBimsUCECKbCmKD7UL7g?e=yZmBqc​ 

      • Jihwan_Kim's avatar
        Jihwan_Kim
        Super User

        Hi,

        Sorry I don't think I understand 100%. I cannot get the number, that you provided, by pbix file. 

        I assume you are asking about the below?

        Please check the below picture and the attached pbix file.