Forum Discussion
How to improve Performance for this Dax
- 1 year ago
Hi vengadesh_p Try this:
ActiveContracts = VAR StartofThisPeriod = LASTDATE(Dim_Calendar[Month Start Date]) VAR EndofThisPeriod = ENDOFMONTH(StartofThisPeriod) RETURN CALCULATE( [# Contracts], KEEPFILTERS( Fact_EwContract[Contracts Start Month] <= StartofThisPeriod && Fact_EwContract[Contracts End Month] > EndofThisPeriod ) )Hope this helps!!
If this solved your problem, please accept it as a solution!!
Best Regards,
Shahariar Hafiz - 1 year ago
Hi vengadesh_p
The very obvious reason causing a performance problem here is that you are filtering a table when you only need to filter a column or columns. shafiz_p has provided a good example on how to apply a filter over a column but still keep the row context. You can also refer this blog: https://www.sqlbi.com/articles/using-keepfilters-in-dax/
Hi vengadesh_p
The very obvious reason causing a performance problem here is that you are filtering a table when you only need to filter a column or columns. shafiz_p has provided a good example on how to apply a filter over a column but still keep the row context. You can also refer this blog: https://www.sqlbi.com/articles/using-keepfilters-in-dax/