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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mft_87
Helper I
Helper I

Fetch date based on a field value in advance editor

Dears,

 

I am fetching the data from SQL database using the below query

 

let
Source = Sql.Databases("database name"),
evo = Source{[Name="evo"]}[Data],
dbo_F_CONTRACT = evo{[Schema="dbo",Item="F_CONTRACT"]}[Data]
in
dbo_F_CONTRACT

 

The above query is giving me the data for all contracts, that bring in 100000 lines items, but I need to bring the data only related to the contract I am making the report for using field where CTR_PREFIX = Contract Prefix (every prefix I add here, the query should only bring the data for that specific prefix.)

 

F_Contract is a table, and CTR_PREFIX is the Field I need to filter

 

Can someone help me how to add this to the query as I am new to power bi and dax.

 

I would highly appreciate your help and support

 

Regards,

2 ACCEPTED SOLUTIONS
Mariusz
Community Champion
Community Champion

Hi @mft_87 

 

You can filter CTR_PREFIX  column in Power Query, and as long as you are careful not to break Query Folding ( by adding unsupported functions before your filter ) the native query will include this filters in the SQL that is sent to the server, see the below for the ref.

image.png

Also please see the link to the documentation below.

https://docs.microsoft.com/en-us/power-query/power-query-folding

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn
 
 

View solution in original post

v-juanli-msft
Community Support
Community Support

Hi @mft_87 

Mariusz shows how to filter data in Power Query.

You could click on the menu of the column to apply filters.

Capture13.JPG

If you want to limit data which imported into Power BI, you could write sql query as below:

Capture14.JPG

 

 

Best Regards
Maggie
Community Support Team _ Maggie Li
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

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @mft_87 

Mariusz shows how to filter data in Power Query.

You could click on the menu of the column to apply filters.

Capture13.JPG

If you want to limit data which imported into Power BI, you could write sql query as below:

Capture14.JPG

 

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Mariusz
Community Champion
Community Champion

Hi @mft_87 

 

You can filter CTR_PREFIX  column in Power Query, and as long as you are careful not to break Query Folding ( by adding unsupported functions before your filter ) the native query will include this filters in the SQL that is sent to the server, see the below for the ref.

image.png

Also please see the link to the documentation below.

https://docs.microsoft.com/en-us/power-query/power-query-folding

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn
 
 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors