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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

list the most recent value in a calculated table

Hello,

 

I have datasource where I list all audits performed to a project.

 

I then have a calculated table that filters out the last ones audited in the last 30 days. These are considered "recent". Using the formula below

= Table.SelectRows(#"Renamed Columns", let latest = List.Max(#"Renamed Columns"[AuditDate]) in each Date.IsInPreviousNDays([AuditDate], 30) or [AuditDate] = latest)

 

But it snaps when a project is audited that was still within those 30 days. This is because it is trying to add the same value twice to in a one-to-one column.

 

How can I fix it?

 

Thank you for your help.

 

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

Hi,

 

In this scenario, since you want to get the most recent 30 records from the table, you can create a numeric date key column in your table, and use TOPN() function to create you calcualted table.

 

Recent 30 Days = TOPN(30,Table,Table[DateKey])

 

Regards,

Simon

View solution in original post

1 REPLY 1
v-sihou-msft
Microsoft Employee
Microsoft Employee

Hi,

 

In this scenario, since you want to get the most recent 30 records from the table, you can create a numeric date key column in your table, and use TOPN() function to create you calcualted table.

 

Recent 30 Days = TOPN(30,Table,Table[DateKey])

 

Regards,

Simon

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors