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

Help with power query code

hello to tod@s, I need your help, I am currently connected to a server importing the data. What happens is that the server does not overpend the data when it is updated so it is duplicated; triple, etc. the data.

I have the update dates, however I have no knowledge of a code that allows me to take the last update date, currently only updates me with the update date of October 4:

Let
Source - Sql.Databases("amsazsdw01.database.windows.net"),
amsazsdw01 - Origin-[Name-"amsazsdw01"]-[Data],
amsa_staged_sap_ehs_ZEHS_REP14 . . . . . . . . . . . . . . . . . . . . . . . . . ZEHS_REP14 amsa_staged_sap_ehs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
"Filtered Rows" - Table.SelectRows(amsa_staged_sap_ehs_ZEHS_REP14, each ([COMPANY] ? "Minera Los Pelambres / ID: 187")),
"Removed Columns" - Table.RemoveColumns(-"Filtered Rows","MANDT", "RUT_EMP", "QUESTION1", "QUESTION2", "QUESTION3"-),
"Filtered Rows1" - Table.SelectRows(-"Removed Columns", each ([fecextr2] - #date(2020, 10, 4)))
in
"Filtered Rows1"

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on my tests, there is no option to get the lastest updated datetime. Here is my codes in 'Advanced Editor'.

let
    Source = Sql.Databases("ServerName"),
    test = Source{[Name="DataBaseName"]}[Data]
in
    test

 

b1.png

 

You may try using corresponding names to name the table and then filter the latest one with 'Table.SelectRows'.

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on my tests, there is no option to get the lastest updated datetime. Here is my codes in 'Advanced Editor'.

let
    Source = Sql.Databases("ServerName"),
    test = Source{[Name="DataBaseName"]}[Data]
in
    test

 

b1.png

 

You may try using corresponding names to name the table and then filter the latest one with 'Table.SelectRows'.

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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