Forum Discussion
vgeldbr
4 years agoHelper IV
Calculated Column across row context
I'm stumped. I want to create a calculated column for purposes of filtering and slicing the table but I need the value to consider other rows in the table. Consider the table below: I would...
- 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
PaulOlding
4 years agoSolution Sage
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 >= 1
which gets you a True/False column
vgeldbr
4 years agoHelper IV
Thanks. This works perfectly. I'm not sure if I can mark both your PaulOlding solution and ValtteriN solution as acceptable. Going to try!