Forum Discussion

sdhn's avatar
sdhn
Icon for Responsive Resident rankResponsive Resident
4 years ago
Solved

numerator and denominator

Hello All,

 

In a table  "DH001" , I have a Column called "MName".

 Values in the column are as:

 

Column: "MName"

------- Human_Visit

------- BOT_Visit

-------Standard_Request_Caching

-------Total Request 

 

I want to calculate % as below:

Standard_Request_Caching/Total Request 

 

Help will be appreciated.  Thanks 

 

  • Hi sdhn ,

     

    Then modify the DAX as follows:

    prop = 
    var t1 = CALCULATE(SUM(DH001[MValue]), DH001[MName] = "Standard_Request_Caching")
    var t2 = CALCULATE(SUM(DH001[MValue]), DH001[MName] = "Total Request")
    RETURN
    t1/t2

    Thanks,

    Pragati

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    can you show a screenshot of the column?

  • Hi sdhn ,

     

    If I understand correctly - "you want proportions based on the count".

    You can write a simple DAX measure as follows:

    prop = 
    var t1 = CALCULATE(COUNT(DH001[MName]), DH001[MName] = "Standard_Request_Caching")
    var t2 = CALCULATE(COUNT(DH001[MName]), DH001[MName] = "Total Request")
    RETURN
    t1/t2
    

     Then convert this measure to a "percentage" using following option in Power BI from top ribbon:

    Click on your measure, then on the top ribbon choose "%" icon.

    Thanks,

    Pragati

    • sdhn's avatar
      sdhn
      Icon for Responsive Resident rankResponsive Resident

      Actually i have already counts in other column as:

      Column: "MName", --------------- "MValue"

      ------- Human_Visit,----------------345000

      ------- BOT_Visit,-------------------12000

      -------Standard_Request_Caching, 4500

      -------Total Request ,---------------4000

       

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

        Hi sdhn ,

         

        Then modify the DAX as follows:

        prop = 
        var t1 = CALCULATE(SUM(DH001[MValue]), DH001[MName] = "Standard_Request_Caching")
        var t2 = CALCULATE(SUM(DH001[MValue]), DH001[MName] = "Total Request")
        RETURN
        t1/t2

        Thanks,

        Pragati