Forum Discussion
Anonymous
3 years agoNot applicable
Optimize DAX Code
Hi, I have created this DAX command: ∑ plná erózia kmeň = //: Výpočet období pre time intelligence VAR EndDate = MAX(tbl_kalendar[datum]) VAR StartDate = EDATE(EndDate,-12)+1 VAR Actua...
larsheinemann
3 years agoFrequent Visitor
Hi Lucia,
Minimize Unnecessary Calculations:
- Reduce the complexity where possible, like avoiding repeated calculations.
- If any of the variables are constant across your data and don't change over time, calculate them separately, and then reference them.
Reduce the Amount of Data Being Processed:
- If there are any filters that can be applied before calculating (i.e., in the CALCULATETABLE function), you can reduce the amount of data that needs to be processed.
- Consider aggregating data at a higher level if detail isn't needed.
Consider Using Aggregated Tables:
- If you're performing the same calculations repeatedly over different periods, you might want to consider creating an aggregated table (e.g., using a summary table that's refreshed periodically or during data refresh). This can help shift some of the computational load from report-rendering time to data-refresh time.
Revise Calculations Where Possible:
- You may be able to revise some of the calculations to be more efficient. For example, your logic with DISTINCTCOUNTNOBLANK and VALUES inside SELECTCOLUMNS seems complex and potentially redundant.
- Some calculations might be done more efficiently using calculated columns in the Power BI data model rather than all in a single measure.