Forum Discussion

MaccoP's avatar
MaccoP
Regular Visitor
7 years ago
Solved

Mapping suppliers with different categories

Hi, I have a long list of suppliers with latitude and longitude and a category (Milk, Honey, Bread etc). The data is from an old Excel database where each supplier can be on multiple rows if they su...
  • tex628's avatar
    tex628
    7 years ago

    I would proberbly make a calculated column in the dataset defining if the row is related to a company supplying both honey and milk. 

    CompanyProduceCategory
    Company 1HoneyMilk/Honey
    Company 1MilkMilk/Honey
    Company 2HoneyN/A
    Company 2WheatN/A
    Company 3HoneyMilk/Honey
    Company 3MilkMilk/Honey
    Company 4BreadN/A


    The calculated column would proberbly look somehting like this:

    Column =
    VAR Company = *Table'[Company]
    Return
    IF(
    AND(
    CALCULATE(
    COUNTROWS( 'Table' ),
    ALL('Table'),
    'Table'[Company] = Company,
    'Table'[Produce] = "Honey"
    ) > 0 ,
    CALCULATE(
    COUNTROWS( 'Table' ),
    ALL('Table'),
    'Table'[Company] = Company,
    'Table'[Produce] = "Milk"
    ) > 0 ),
    "Milk/Honey",
    "N/A"
    )