locked
Help Creating a DAX Expression For Percent of Sales Wins RRS feed

  • Question

  • I have a table that looks like the one below.

    There are many districts with many customers in each district. A Y in the Win Column means we sold the account something

    AccountName,District,Win(Y/N)

    ABC,South East,Y

    BCD,South East,N

    CDE,North East,N

    DEF,West,Y

    I'm trying to calculate the percentage of Wins per District. I've been trying to figure out how to calculate the number of accounts per district and divide them by the number of wins but I haven't been successful. Can anyone help?

    Saturday, January 30, 2016 1:20 AM

Answers

  • You are on the right track. I assume the 'per district' part of your question applies to using the District column as e.g. a row label in a pivot table. The number of accounts can be calculated with

    NumberAccounts:=COUNTA(Table[AccountName])

    The number of wins is the same, but filtered on Win = Y:

    NumberWins:=CALCULATE([NumberAccounts],Table[Win]="Y")

    and

    Wins%:=DIVIDE([NumberWins],[NumberAccounts])

    • Proposed as answer by Charlie Liao Tuesday, February 16, 2016 1:30 AM
    • Marked as answer by Charlie Liao Wednesday, February 17, 2016 2:15 AM
    Saturday, January 30, 2016 7:11 AM
    Answerer