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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
dixon1983
Regular Visitor

Apply a Filter to Data during Import from Teradata DB

Hi,

I wonder if someone can help.

 

I have created a connection within Power BI to a database located on Teradata.

 

There are over 100M rows of data on the database of which I only want to import a certain amount.

 

The criteria for what I want to import is based on the field LOADDATE of which I only want to import the last 7 days (including today).

 

The advanced editor shows the following - is this where I need to place code to filter what is imported? If so please could someone advise what I need to enter?

 

let
    Source = Teradata.Database("xxx.yyy.COM", [HierarchicalNavigation=true]),
    IQR_ODS_V = Source{[Schema="IQR_ODS_V"]}[Data],
    IQR_ABC_DEF_ALL_F_V1 = IQR_ODS_V{[Name="IQR_ABC_DEF_ALL_F_V"]}[Data]
in
    IQR_ABC_DEF_ALL_F_V1

 

 

Many thanks for any help.

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

Hi @dixon1983,

One way, you can filter date rows using screen operation. Please click the triangle-Date filters->Between as picture1 shown, then click the last 7 day and today in the canlendar shown in picture2

picture1picture1      picture2picture2

Or you can use the query statement as follows.

 

let
    Source = Teradata.Database("xxx.yyy.COM", [HierarchicalNavigation=true]),
    IQR_ODS_V = Source{[Schema="IQR_ODS_V"]}[Data],
    IQR_ABC_DEF_ALL_F_V1 = IQR_ODS_V{[Name="IQR_ABC_DEF_ALL_F_V"]}[Data]
   #"Filtered Rows" = Table.SelectRows(#"Changed Type", each [Date] >= #date(2018, 2, 14) and [Date] <= #date(2018, 2, 21))
in
    #"Filtered Rows"


Best Regards,
Angelia

View solution in original post

1 REPLY 1
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @dixon1983,

One way, you can filter date rows using screen operation. Please click the triangle-Date filters->Between as picture1 shown, then click the last 7 day and today in the canlendar shown in picture2

picture1picture1      picture2picture2

Or you can use the query statement as follows.

 

let
    Source = Teradata.Database("xxx.yyy.COM", [HierarchicalNavigation=true]),
    IQR_ODS_V = Source{[Schema="IQR_ODS_V"]}[Data],
    IQR_ABC_DEF_ALL_F_V1 = IQR_ODS_V{[Name="IQR_ABC_DEF_ALL_F_V"]}[Data]
   #"Filtered Rows" = Table.SelectRows(#"Changed Type", each [Date] >= #date(2018, 2, 14) and [Date] <= #date(2018, 2, 21))
in
    #"Filtered Rows"


Best Regards,
Angelia

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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