Forum Discussion
DAX optimization
- 6 years ago
Hi, Anonymous
Here are some suggestions about optimize your model.
- Remove unused tables or columns, where possible.
- Avoid distinct counts on fields with high cardinality – that is, millions of distinct values.
- Take steps to avoid fields with unnecessary precision and high cardinality. For example, you could split highly unique datetime values into separate columns – for example, month, year, date, and so on. Or, where possible, use rounding on high-precision fields to lower cardinality – (for example, 13.29889 -> 13.3).
- Use integers instead of strings, where possible.
- Be wary of DAX functions, which need to test every row in a table – for example, RANKX – in the worst case, these functions can exponentially increase run-time and memory requirements given linear increases in table size.
- When connecting to data sources via DirectQuery, consider indexing columns that are commonly filtered or sliced again. Indexing greatly improves report responsiveness.
For further informatiom, please refer to the official document .
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If this month start is a date. Create a date table move the calcultaion there.
Example
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all(date),date[date] <=maxx(date,date[date])))
See if it improves performance
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
hi Amit
here is my date table. i have shown where i want the cumulative formula to start and end at for each of the 3 periods. I have included the excel formula on how the result is to be calculated. you could use the rolling month column??? this splits the periods up too