Forum Discussion

MStark's avatar
MStark
Helper III
3 years ago
Solved

Row Percentages

Im trying to get the % of potential customers by Item and my measure is only giving it by department. How can I get it for each Row?

This is what Im looking for in Excel:

In Power BI only getting the total:

 

Can anyone help with this?

 

If it helps, my excel data looks like this:

 

  • MStark 
    It should be rather 81.50, if you want to be precise:

    Measure = 
    
    var Potential = CALCULATE(SUMX(FILTER('Table', 'Table'[Department name] = "Potential"), 'Table'[Amount]), ALL('Table'[Department name], 'Table'[Account title]))
    var TheRest = SUM('Table'[Amount])
    var check = DIVIDE(TheRest, Potential)
    return check

     

     

7 Replies

  • Hello, MStark 
    You can do something like this:

    Measure = 
    
    var Potential = CALCULATE(SUMX(FILTER('Table', 'Table'[Department name] = "Potentional"), 'Table'[Amount]), ALL('Table'))
    var TheRest = SUM('Table'[Amount])
    return DIVIDE(TheRest, Potential)
     
    • MStark's avatar
      MStark
      Helper III

      Thanks for taking the time to try to help!

      I tried your measure but getting incorrect results. It might be because the Potential Sum is including the potential customers for all 3 months. Maybe the "All" is messing it up? Any ideas?

       

       

      For May, the total percentage should be 82% 

       

       5/31/2022
      1on1           0.03
      Consulting           0.17
      Corp           0.28
      Online           0.31
      Onsite                -  
      Training           0.02
       82%

       

      Thanks again for your assistance!

      • vojtechsima's avatar
        vojtechsima
        Super User

        MStark 
        You're using a different formula than I do tho.
        Please give me data in text form so I can play with them in my environment, please.