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
clarkpaul
Helper I
Helper I

Limit Data Retrieval Based on Friday Dates

Our data warehouse has a daily snapshot of inventory.  I want to show trends over time on a weekly basis (every Friday).
I have a dynamic date table that has every date from 1/1/2024 to current date.  I filtered it down to show only the Friday dates and created a list called "Fridays"
How can I use this to limit my data pull from the data warehouse? (The name of the field is SNAPSHOT_DATE)

clarkpaul_0-1723295361886.png 

clarkpaul_1-1723295404448.png

 

let
Source = Odbc.DataSource("dsn=Snowflake", [HierarchicalNavigation=true]),
MAC_RAPID_PROD_Database = Source{[Name="MAC_RAPID_PROD",Kind="Database"]}[Data],
APPS_Schema = MAC_RAPID_PROD_Database{[Name="APPS",Kind="Schema"]}[Data],
FACT_SCM_ONHAND_DETAILS_SNAPSHOT_V_View = APPS_Schema{[Name="FACT_SCM_ONHAND_DETAILS_SNAPSHOT_V",Kind="View"]}[Data]
in
FACT_SCM_ONHAND_DETAILS_SNAPSHOT_V_View

 

1 ACCEPTED SOLUTION
ahadkarimi
Solution Specialist
Solution Specialist

Try this code, If you have any questions or need more info, just hit me up!

let
Fridays = YourFridaysListQuery,
Source = Odbc.DataSource("dsn=Snowflake", [HierarchicalNavigation=true]),
MAC_RAPID_PROD_Database = Source{[Name="MAC_RAPID_PROD",Kind="Database"]}[Data],
APPS_Schema = MAC_RAPID_PROD_Database{[Name="APPS",Kind="Schema"]}[Data],
FACT_SCM_ONHAND_DETAILS_SNAPSHOT_V_View = APPS_Schema{[Name="FACT_SCM_ONHAND_DETAILS_SNAPSHOT_V",Kind="View"]}[Data],
FilteredData = Table.SelectRows(FACT_SCM_ONHAND_DETAILS_SNAPSHOT_V_View, each List.Contains(Fridays, [SNAPSHOT_DATE]))

in
FilteredData

View solution in original post

2 REPLIES 2
ahadkarimi
Solution Specialist
Solution Specialist

Try this code, If you have any questions or need more info, just hit me up!

let
Fridays = YourFridaysListQuery,
Source = Odbc.DataSource("dsn=Snowflake", [HierarchicalNavigation=true]),
MAC_RAPID_PROD_Database = Source{[Name="MAC_RAPID_PROD",Kind="Database"]}[Data],
APPS_Schema = MAC_RAPID_PROD_Database{[Name="APPS",Kind="Schema"]}[Data],
FACT_SCM_ONHAND_DETAILS_SNAPSHOT_V_View = APPS_Schema{[Name="FACT_SCM_ONHAND_DETAILS_SNAPSHOT_V",Kind="View"]}[Data],
FilteredData = Table.SelectRows(FACT_SCM_ONHAND_DETAILS_SNAPSHOT_V_View, each List.Contains(Fridays, [SNAPSHOT_DATE]))

in
FilteredData

tharunkumarRTK
Super User
Super User

@clarkpaul 

You can add one more line to your m-cdoe and it filters your data.

let
Source = Odbc.DataSource("dsn=Snowflake", [HierarchicalNavigation=true]),
MAC_RAPID_PROD_Database = Source{[Name="MAC_RAPID_PROD",Kind="Database"]}[Data],
APPS_Schema = MAC_RAPID_PROD_Database{[Name="APPS",Kind="Schema"]}[Data],
FACT_SCM_ONHAND_DETAILS_SNAPSHOT_V_View = APPS_Schema{[Name="FACT_SCM_ONHAND_DETAILS_SNAPSHOT_V",Kind="View"]}[Data],
FilteredDate = Table.SelectRows(FACT_SCM_ONHAND_DETAILS_SNAPSHOT_V_View, each List.Contains(Fridays , [SNAPSHOT_DATE] ) )
in

 

But I dont think the above step supports query folding, I would suggest you to perform this transformation in a SQL statement and pass it as a native query. 

https://learn.microsoft.com/en-us/power-query/native-database-query

 

You are using odbc connection and it does support native query.

 

 

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 Kudoed Authors