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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
BTMoylan
Frequent Visitor

Filter Multiple Responses

Hey All, 

 

I have been building out a report that can filter based off a business location and type of product/service. I am almost done, but I am hoping to refine my results even more. If you look at the picture below, you will see my export table, this table gives me a list of contacts to reach out to for a given project. I am able to filter the results by type of product/service and location which is fantastic. However, if a business has mutiple locations I get all locations of that business not just the one location that is in range of the project. 

 

If you look at the first result on the list "APAC" this company has locations in Kansas and Oklahoma. You can also see in the second column the distance of that location to the project. So I want to make a filter that will keep the one(s) with the smallest distance, but only if that business has more than one address. In this case it would filter out the first two rows with a distance of 321.83 KM and keep the location that is only 48.80 KM away.

   Mutiple Results Filter v.2.png

Any help is greatly appreciated thanks! 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @BTMoylan,

You can write a measure formula to extract the current distance and min distance based on category to compare and return flag. Then you can use this formula and flag as condition on visual level filter to filter records:

flag =
VAR currDist =
    MIN ( Table[Distance] )
VAR minDist =
    CALCULATE (
        MIN ( Table[Distance] ),
        ALLSELECTED ( Table ),
        VALUES ( Table[Organization] ),
        VALUES ( Table[product/service] )
    )
RETURN
    IF ( currDist = minDist, "Y", "N" )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @BTMoylan,

You can write a measure formula to extract the current distance and min distance based on category to compare and return flag. Then you can use this formula and flag as condition on visual level filter to filter records:

flag =
VAR currDist =
    MIN ( Table[Distance] )
VAR minDist =
    CALCULATE (
        MIN ( Table[Distance] ),
        ALLSELECTED ( Table ),
        VALUES ( Table[Organization] ),
        VALUES ( Table[product/service] )
    )
RETURN
    IF ( currDist = minDist, "Y", "N" )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.