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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
ucciod
New Member

Improve very slow measure

I have this measure

Delta Movimento =
VAR DefaultDate = DATE(1900, 1, 1)
VAR ConfDate = SELECTEDVALUE(DimPurchaseOrder[ConfirmedShippingDate], DefaultDate)
VAR MovDate = SELECTEDVALUE(FactWmsInventory[MovementDate])
VAR ReqDate = SELECTEDVALUE(DimPurchaseOrder[RequestedShippingDate])

RETURN
SWITCH(
TRUE(),
ConfDate = DefaultDate, DATEDIFF(MovDate, ReqDate, DAY),
DATEDIFF(MovDate, ConfDate, DAY)
)

I use it in a table with 15 field from different tables, I can not modify the data model (as in add calculated columns) so i need to use a measure but this one takes minutes. How can I improve this?

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Use DAX Studio to analyze the query plan and server timings.  Verify and adjust your data model and your measure accordingly.

 

DO NOT use 1/1/1900 as a default date.  Do not use default dates. Leave the value blank.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

Use DAX Studio to analyze the query plan and server timings.  Verify and adjust your data model and your measure accordingly.

 

DO NOT use 1/1/1900 as a default date.  Do not use default dates. Leave the value blank.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Carousel June 2024

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

2
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.