Hi @Dharma,
Please see this Forum post by @Greg and all related content in there for more details.
Formatting goes a long way when trying to break down DAX logic.
The outer FILTER filters Customer Names so only rows are returned that meet a condition in the inner FILTER on the supporting 'Customer Banding’ table. DAX works from the inside out, so the inner condition is evaluated before the outer filter condition.
Sales Per Growth Group =
CALCULATE(
[Total Sales],
FILTER(
VALUES( Customer[Customer Names] ),
COUNTROWS(
FILTER(
'Customer Banding',
[Sales Growth_ADC] >= 'Customer Banding'[Min]
&& [Sales Growth_ADC] < 'Customer Banding'[Max]
)
) > 0
)
)
.
- There are 2 filters because 2 different tables are being filtered
- Countrows is a test to see if the filter condition is met, is there is a row returned from the inner Customer Banding table? If so, the customer is kept and if it doesn’t survive the filter it’s omitted.
- Sales Growth measure is used for the test in the inner filter condition and this calculation finally returns the Total sales value of all remaining Customer Names
I hope this is helpful.