Forum Discussion

Unknown23's avatar
Unknown23
New Member
4 years ago
Solved

Calculate Percentage

 

I want to calculate the percentage as a percentage of row total like above table and show only approved in a chart. 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Unknown23 ,

     

    Suppose I have a table like this.

    Measures.

     

    Approved = 
    VAR _num = CALCULATE(COUNTROWS('Table'),'Table'[Status]="Approved")
    VAR _total = COUNTROWS('Table')
    RETURN
    DIVIDE(_num,_total)
    Open = 
    VAR _num = CALCULATE(COUNTROWS('Table'),'Table'[Status]="Open")
    VAR _total = COUNTROWS('Table')
    RETURN
    DIVIDE(_num,_total)
    Submitted = 
    VAR _num = CALCULATE(COUNTROWS('Table'),'Table'[Status]="Submitted")
    VAR _total = COUNTROWS('Table')
    RETURN
    DIVIDE(_num,_total)

     

    Attached PBIX file for reference.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data

3 Replies

  • Nathaniel_C's avatar
    Nathaniel_C
    Icon for Community Champion rankCommunity Champion

    Hi Unknown23 ,
    You mean like this?


    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
    Nathaniel

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Unknown23 ,

     

    Suppose I have a table like this.

    Measures.

     

    Approved = 
    VAR _num = CALCULATE(COUNTROWS('Table'),'Table'[Status]="Approved")
    VAR _total = COUNTROWS('Table')
    RETURN
    DIVIDE(_num,_total)
    Open = 
    VAR _num = CALCULATE(COUNTROWS('Table'),'Table'[Status]="Open")
    VAR _total = COUNTROWS('Table')
    RETURN
    DIVIDE(_num,_total)
    Submitted = 
    VAR _num = CALCULATE(COUNTROWS('Table'),'Table'[Status]="Submitted")
    VAR _total = COUNTROWS('Table')
    RETURN
    DIVIDE(_num,_total)

     

    Attached PBIX file for reference.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data