Forum Discussion

A-Rae's avatar
A-Rae
New Member
3 years ago
Solved

DAX formula for Percentage between two columns

Hello,

I'm new to Power BI/DAX.  I need to create a column on my table to show the percentage of the New Sales column compared to the salesperson's Quota column (see pic), their % Achievement .  For example, with the below picture, the % Achievement for the for the first 2 lines would be 0% and 5% respectively. 
These columns are each from separate Salesforce Reports, if that matters.

 

Any ideas for how to get this to work would be appreciated. 

Thank you!

 

  • hi A-Rae 

    try to

    1)create a measure with this code:

    Achievement%=
    FORMAT(
        DIVIDE(
            SUM(Sales[Sales]),
            SUM(Budget[Quota]),
         ),
        "0.0%"
    )
     
    2)then plot any visual with this measure.

3 Replies

  • hi A-Rae 

    try to

    1)create a measure with this code:

    Achievement%=
    FORMAT(
        DIVIDE(
            SUM(Sales[Sales]),
            SUM(Budget[Quota]),
         ),
        "0.0%"
    )
     
    2)then plot any visual with this measure.
  • v-xiaotang's avatar
    v-xiaotang
    Icon for Community Support rankCommunity Support

    Hi A-Rae 

    Please share some sample data and expectd output.

     

    Best Regards,

    Community Support Team _Tang

    If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

  • Nico_Kl's avatar
    Nico_Kl
    Frequent Visitor

    To create a column that shows the percentage of New Sales compared to the salesperson's Quota in DAX, you can use the following formula:

     

    New Sales % = DIVIDE(New Sales, Quota)

     

    This formula will divide the New Sales column by the Quota column and return the result as a decimal value. To convert the decimal value to a percentage, you can multiply the result by 100 and add the % symbol.

    Here is an example of how the formula could be used in DAX:

     

     New Sales % = FORMAT(New Sales / Quota, "0.00%")

     

    This formula will divide the New Sales column by the Quota column, format the result as a percentage with two decimal places, and add the % symbol.

     

    Please note that the exact syntax and names of the columns and functions may vary depending on your specific data set and Power BI configuration.