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
olimilo
Responsive Resident
Responsive Resident

Trying to create a filtered list from another table

I'm trying to create a column with a list of holidays (l_Holidays) for my main table (Source) using an existing Holiday table. But upon checking, it always returns an empty list (which should not be the case). Anyone know what I'm doing wrong here? The holiday list returned should be the holidays for that country.

 

= Table.AddColumn(
    Source,
    "l_Holidays",
    each Table.Column(Table.SelectRows(Holiday, each Holiday[Country] = [Country]),
    "Date")
)
1 ACCEPTED SOLUTION

Hello @olimilo 

 

I created a small example to test.

Seemingly it works

Please check the attached Excel file

 

flost.png


Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

@olimilo 

 

try this modification

 

= Table.AddColumn(
    Source,
    "l_Holidays",
    each let mycountry=[Country] in Table.Column(Table.SelectRows(Holiday, each [Country] = mycountry),
    "Date")
)

Regards
Zubair

Please try my custom visuals

Hi @Zubair_Muhammad ,

I tried your edit and am still getting blank lists for each row. Do you know what could be the problem here?

 

Hello @olimilo 

 

I created a small example to test.

Seemingly it works

Please check the attached Excel file

 

flost.png


Regards
Zubair

Please try my custom visuals

Thanks @Zubair_Muhammad 

I was able to make it work from my side and was able to add a couple more conditions in. Not exactly sure what went wrong though.

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.