Forum Discussion
DAX performance FILTER & RELATED issue
Hi there,
I was facing severe performance issues on this DAX formula:
CALCULATE(COUNTROWS('Measure Touchpoint');FILTER('Touchpoint Attribute';'Touchpoint Attribute'[IsIn30PC]=1))
It never finished and fille up the total RAM (14GB).
Introducing the RELATED formula dramatically increased the performance and lowered the memory usage:
CALCULATE(COUNTROWS('Measure Touchpoint');FILTER('Measure Touchpoint';RELATED('Touchpoint Attribute'[IsIn30PC])=1))
Can somebody explain this please :)?
Both tables share a 1:1 relation. Each table has about 6 million rows.
Thank you
Oliver
4 Replies
- Ashish_Mathur
Super User
Hi,
Since you are comparing a column to a fixed value, you do not need the FILTER function. Try this
=CALCULATE(COUNTROWS('Measure Touchpoint');'Touchpoint Attribute'[IsIn30PC]=1)Does this work?
- oester
Advocate II
Thanks for your reply.
Isn't this just a syntactical shortcut of the FILTER version? Anyway, my questions is about the difference between using RELATED or not in a FILTER statement
- Ashish_Mathur
Super User
Hi,
As long as there is a relationship between Measure Touchpoint table to the Touchpoint attribute table, my fomrula should work fine. Have you tried it?