Forum Discussion

Sachet_716's avatar
Sachet_716
Helper I
8 years ago
Solved

DIVIDE DISTINCT COUNT WITH FILTER

I need help please...   I have this measure:      Measure % = DISTINCTCOUNT (Sales [CustomerCode]) / DISTINCTCOUNT (CustomerList[CustomerCode])     In my Sales table, I have different brands and...
  • ChandeepChhabra's avatar
    ChandeepChhabra
    8 years ago

    Hi Sachet_716

     

    Lidya Anonymous is correct here. You need to have all possible codes in the customer table.

     

    Just in case if you still want to make this work. Do the following

     

    Step 1 - Delete the relationship between Sales and Customer Tables

     

    Step 2 - Add a following measure to the Customer table 

    Total Customer Country Wise = CALCULATE(DISTINCTCOUNT(CUSTOMER[CUSTOMER CODE]),ALLSELECTED(CUSTOMER[COUNTRY]))

     

    Step 3 : Update your Coverage % formula to

    Coverage% = DIVIDE (DISTINCTCOUNT('SALES DATA'[Customer Code]) ,[Total Customer Country Wise])

     

    Step 4: Insert a slicer on Country from Customer Table and NOT the Sales Table

     

    I am supposing it should then work!

     

    Sending you 2 files to look over -

    With Relationships and Corrected Data

    Without Relationships and (As is Data)