Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MaccoP
Regular Visitor

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 supply to different categories. For example Supplier X can supply both Milk and Honey and will have two records (rows). I want to map  ONLY suppliers delivering both Milk and Honey. How do I do this? 

KR,

M

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

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"
)

Connect on LinkedIn

View solution in original post

4 REPLIES 4
tex628
Community Champion
Community Champion

What exactly do you mean by map here? Could you show the desired outcome somehow?


Connect on LinkedIn

I want to create a map where I only show a marker where a company deliveres both Milk and Honey (in the attached case the yellow). My problem is that a record occurs twice (two separate rows in excel) for for the yello company, once for Milk and once for Honey. In the attached example it shows all companies delivering either milk or honey

Capture.PNG

tex628
Community Champion
Community Champion

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"
)

Connect on LinkedIn


@tex628 wrote:

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"
)

Great! Thank you 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.