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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
some1else
Helper II
Helper II

Get value from column based on lookup

Hi guys.

 

I'm new to PBI and I'm trying to figure out something.

 

I need to get a unique value from a table, based on the filtered selection of another related table (slicer).

Table with street lenght:

STREETDISTRICTLENGHT
street1A1
street1B2

 

I need to get the lenght of street name, IF the district matches the district applied on this slicer selection below.

Let's assume the slicer selection is from district "B".

 

Right now, the final table is showing multiple lenght occurrences (different values of lenght), as much times as the street name repeats itself. I just need to show the value "2" from this example.

1.jpg

2 REPLIES 2
some1else
Helper II
Helper II

Thanks for the reply Allan

 

Below is the the current relationship.

Each county (concelho) can have multiple ocorrencies of street name (Rua), but each parish (freguesia) only has one street name.

I created an in between column to avoid many to many relationships.

 

I need to get specific info from the table COMP_RUA, which is it's lenght.

 

If I insert this in a visual and filter by min value it gives me the correct street lenght but this somehow doesn't seem okay. I also tried LOOKUPVALUE but gave me an error. For example, in Excel I could use VLOOKUP to search for that specific value.

COMPRIMENTO = 
CALCULATE (
    FIRSTNONBLANK ( COMP_RUA[COMPRIMENTO], 1 ),
    FILTER (
        COMP_RUA,
        OTs[RUA] = COMP_RUA[ENDERECO]
    )
)

relation.jpg

lookup.jpg

 

Is there a way to get the specific value and stick it in a card without any problems? 🙂

v-alq-msft
Community Support
Community Support

Hi, @some1else 

 

Could you please show us some sample data and expected result with OneDrive for business? Do mask sensitive data before uploading. Thanks.

 

Best Regards

Allan

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Power BI Header Change

Power BI Header Update

Read about the exciting updates for the Power BI forum.