Forum Discussion
Calculated Column across row context
- 4 years ago
Hi,
For this kind of filtering I would create a filter measure and apply it to your visual.
So e.g. here we only keep rows where our item's material is WoodFilter when item =var _item = MAX(ItemExample[Item]) returnIF(COUNTROWS(FILTER(all('Matrix example'),'Matrix example'[Item]=_item&&'Matrix example'[Material]="Wood"))>0,1,0)
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up! - 4 years ago
Hi vgeldbr
Here's some DAX for a calculated column
Is MFS = VAR _Rows = CALCULATE( COUNTROWS(Products), Products[LeadershipRptInvestGroup] = "MFS Production Cloud", ALLEXCEPT(Products,Products[Product]) ) RETURN _Rows >= 1which gets you a True/False column
Thanks ValtteriN , I will give this a try. The reason I did not pursue (and still have reservations about using a measure) is that any filtering then has to be applied to every visual on the page.
vgeldbr
Ah, this is a common issue. However, I have workaround for this. You can create a calculation group using visual studio or tabular editor and apply the logic there.
e.g.
CALCULATE(
SELECTEDMEASURE(),
FILTER('Table',[Filter measure]=1))
Then you can apply this logic on page level by selecting the calculation group.