Forum Discussion
tomerfaith
8 years agoFrequent Visitor
Interaction Between FILTER() and ALL()
First let me describe the situation: I have a table with "Order Date" , "Supply Date" and "Sum" columns, and a date table. I created a relationship between "Supply Date" and the date table. and i n...
v-xjiin-msft
8 years agoSolution Sage
Hi tomerfaith,
Yes, using ALL() is a right method. But you should put ALL() function into Filter(). Modify your expression like this:
Order Sum Open At The Time 2 = VAR minDate = MIN('Calender'[Date]) RETURN
VAR maxDate = MAX('Calender'[Date]) RETURN
CALCULATE(SUM('ORD'[Sum]),//ALL('ORD'[Supply Date]),
FILTER(ALL('ORD'),
'ORD'[Order Date]<=maxDate && 'ORD'[Supply Date]>=minDate
)
)
Thanks,
Xi Jin.
tomerfaith
8 years agoFrequent Visitor
Yes, the problem is that when I use the implemantation you suggested:
Order Sum Open At The Time 2 = VAR minDate = MIN('Calender'[Date]) RETURN
VAR maxDate = MAX('Calender'[Date]) RETURN
CALCULATE(SUM('ORD'[Sum]),//ALL('ORD'[Supply Date]),
FILTER(ALL('ORD'),
'ORD'[Order Date]<=maxDate && 'ORD'[Supply Date]>=minDate
)
) I lose all the filters in my report.
when I actually only want to lose the filters specificly on "Supply Date" column.
my question is how can I do this?
- v-xjiin-msft8 years agoSolution Sage
Hi tomerfaith,
Check this:
Order Sum Open At The Time 2 = VAR minDate = MIN('Calender'[Date]) RETURN VAR maxDate = MAX('Calender'[Date]) RETURN CALCULATE(SUM('ORD'[Sum]),//ALL('ORD'[Supply Date]), FILTER(ALL('ORD'[Supply Date],ORD[Order Date]), 'ORD'[Order Date]<=maxDate && 'ORD'[Supply Date]>=minDate ) )Thanks,
Xi Jin.- tomerfaith8 years agoFrequent Visitor
Sadly I still get similar result:
- v-xjiin-msft8 years agoSolution Sage
Hi tomerfaith,
Could you please share us the pbix file with OneDrive or something else? So that I can dig deeper.
Thanks,
Xi Jin.