Forum Discussion
Anonymous
2 years agoNot applicable
Nested filter context modification
Hey guys. I've stumbled on bit of a pickle. I've got a simple 'Orders' table containing list of order details specifying [Order #], [Date created], [Date closed] and [Age (days)]: The [Date c...
- 2 years ago
You could go all cute and use INTERSECT and USERELATIONSHIP
WIP = var w = max(Dates[Week]) var cr = CALCULATETABLE(VALUES(Orders[Order #]),Dates[Date]<=w) var cl = CALCULATETABLE(VALUES(Orders[Order #]),Dates[Date]>w,USERELATIONSHIP(Dates[Date],Orders[Date Closed])) return countrows(INTERSECT(cr,cl)), or you could simply inactivate both relationships.
WIP = var w = max(Dates[Week]) return CALCULATE(COUNTROWS(Orders),Orders[Date Created]<=w,Orders[Date Closed]>w)
lbendlin
2 years agoSuper User
You could go all cute and use INTERSECT and USERELATIONSHIP
WIP =
var w = max(Dates[Week])
var cr = CALCULATETABLE(VALUES(Orders[Order #]),Dates[Date]<=w)
var cl = CALCULATETABLE(VALUES(Orders[Order #]),Dates[Date]>w,USERELATIONSHIP(Dates[Date],Orders[Date Closed]))
return countrows(INTERSECT(cr,cl))
, or you could simply inactivate both relationships.
WIP =
var w = max(Dates[Week])
return CALCULATE(COUNTROWS(Orders),Orders[Date Created]<=w,Orders[Date Closed]>w)
- Anonymous2 years agoNot applicable
Thank you!
I eventually made it work. But I like your solution with INTERSECT too.
Interesting idea, though, to inactivate both relationships.