cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ben81
Helper I
Helper I

DAX Optimisation

Hi, 

Just wanted to get some pointers on optimising some DAX. I've got a series of DAX measures doing a similiar measures using sum/sumx and countrow functions. These are then in turn used in other measures to add together/subtract and divisions. 

However some are taking sometime to process and I've tried using DAX Studio which has helped pin point some of the slower measures but not sure how to optimise.

Example of a typical measure: 
Measure=

//Determined by user when changing a date slicer
VAR _StartDate = [Start Date]
VAR _EndDate = [Start Date]

RETURN
Calculate (
  SUMX('TABLE1',COLUMN1, COLUMN2),
TABLE1,[COLUMN2] = "value",
DateTBL,[DATE] >= _StartDate & 'DateTbl'[Date] <= _EndDate
)


Is there a better way of writing this?

Pretty much all my measures are like this and then I have some that just go Total = [Measure1] + [Measure2] et..

 

Thanks,

 

Ben

1 REPLY 1
Surya9
Resolver II
Resolver II

Yes you can use this, if you want you can also try DATESBETWEEN (https://docs.microsoft.com/en-us/dax/datesbetween-function-dax)

Helpful resources

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.