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
AnwarHabib
Frequent Visitor

how to create select query in power BI using dynamics 365

How to bring data in power BI having two filters by using select quer , because currently what I am doing is taking too much time in bring data below is the query attached.

_________________________________________________________________________________________________________________________________________

let
Source = OData.Feed("https://toysrus.operations.dynamics.com/data", null, [Implementation="2.0"]),
SalesOrderLines_table = Source{[Name="SalesOrderLines",Signature="table"]}[Data],
#"Filtered Rows" = Table.SelectRows(#"Filtered Rows", each Text.StartsWith([SalesOrderNumber] = "SOO")),
#"Filtered Rows1" = Table.SelectRows(SalesOrderLines_table, each [RequestedReceiptDate] >= #datetimezone(2020, 1, 1, 0, 0, 0, 3, 0) and [RequestedReceiptDate] <= #datetimezone(2021, 1, 1, 0, 0, 0, 3, 0)),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows1",{"RequestedReceiptDate", "SalesOrderLineStatus", "ItemNumber", "ShippingWarehouseId", "DeliveryAddressCity", "OrderedSalesQuantity", "SalesOrderNumber", "LineAmount"})
in
#"Removed Other Columns"

3 REPLIES 3
v-lionel-msft
Community Support
Community Support

Hi @AnwarHabib ,

 

You can choose to use DAX to do it. In fact, DAX performs more efficiently.

 

Best regards,
Lionel Chen

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

ImkeF
Super User
Super User

Hi @AnwarHabib  

if your source supports query folding, it could make sense to turn around the order of the last three steps. 

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

amitchandak
Super User
Super User

@ImkeF , can you help

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.