cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
olimilo
Post Patron
Post Patron

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

View solution in original post

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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors