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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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