Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Calculate using columns with duplicated data

I'm working with some messy sales win/loss data, and I need help. My goal is to calculate vendor consideration rate and vendor win rate. The data table includes the following columns: ID: a unique ...
  • Greg_Deckler's avatar
    3 years ago

    Anonymous Probably the easiest way is to create a disconnected table that lists all of your vendors. We will call this the Vendors table and the column that holds the names of the vendors is called Vendor. Then you can put this into a visualization along with this measure:

    Measure = 
      VAR __Vendor = MAX('Vendors'[Vendor])
      VAR __Deals = COUNTROWS(DISTINCT('Deals'[ID]))
      VAR __Wins = COUNTROWS(DISTINCT(SELECTCOLUMNS(FILTER('Deals',[Winning Vendor] = __Vendor),"__ID",[ID])))
      VAR __Losses = COUNTROWS(FILTER('Deals',[Losing Vendor] = __Vendor))
    RETURN
      DIVIDE(__Wins + __Losses, __Deals, 0)