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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
arunac
New Member

Table.SelectRows with Condition check between two tables

Hi,

I have the two tables below

Transaction data

1) Person Number

2) Effective Date

3) Amount

 

Set up Data

1) Start Date

2) End Date

 

For each row in transaction record,  want to count the number of rows in Setup data that have end date >= Effective Date on transaction record. I tried the below combos on Transaction table record

1) Table.RowCount(Table.SelectRows(#"Set up Data",each #"Set up Data"[End Date]>= [Effective Date] . Error The field 'EFFECTIVE_DATE' of the record wasn't found.
Details:

1) Table.RowCount(Table.SelectRows(#"Set up Data",each #"Set up Data"[End Date]>= #"Transaction data"[Effective Date]

Error: Cyclic reference error 

Can you let me know what is the proper syntax to refer the current table for fetching criteria

1 REPLY 1
AlienSx
Super User
Super User

Hi, @arunac first, create a list of end dates. Then add new column to transaction data table that calculations how many list items are >= than current effective date.

ed_list = List.Buffer(#"Set up Data"[End Date]),
count_column = Table.AddColumn(#"Transaction data", "count", each List.Count(List.Select(ed_list, (x) => x >= [Effective Date])))

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors