Forum Discussion
Dax Optimization
Hi, Akhil_1411
I'd like to suggest you refer to the document about Dax best practice to improve Power BI. Here are some guidance about Dax.
1. Clear the DAX cache before optimizing DAX
2. Format your code
3. Do not change BLANK values to zeros or other strings
4. Use the DISTINCT() and VALUES() functions consistently
5. Use ISBLANK() instead of =Blank() check
6. Use = 0 instead of checking for ISBLANK() || = 0
7. Use SELECTEDVALUE() instead of HASONEVALUE()
8. Use SELECTEDVALUE() instead of VALUES()
9. Use variables instead of repeating measures inside the IF branch
10. Use (a-b)/b along with variables instead of a/b — 1 or a/b*100–100
11. Stop using IFERROR() and ISERROR()
12. Use DIVIDE() instead of /
13. Do not use scalar variables in SUMMARIZE()
14. Use KEEPFILTERS() instead of FILTER(T)
15. Use FILTER(all(ColumnName)) instead of FILTER(values()) or FILTER(T)
16. Avoid using the AddColumns() function inside measure expressions
17. Use the correct data types based on column values
18. Use COUNTROWS instead of COUNT
19. Use SEARCH() with the last parameter
20. ALL vs. ALLExcept
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.