Forum Discussion
Tito
2 years agoHelper IV
add new column in PowerQuery
Hello, I would like to add a new column in PowerQuery. If a customer has Group A, it should return "Group A", otherwise "non Group A". Best regards Tito Data: Rsult
- 2 years ago
Hi Tito ,
You could create it as a Calculated column in the front end=
Group A =var Namecur = [Name] --Current Namevar grouphigh = COUNTROWS(FILTER(List, Table[Group] = "A" && List[Name] = Namecur ))returnif(grouphigh > 0, "Group A", "non Group A")
SamWiseOwl
2 years agoSuper User
Hi Tito ,
You could create it as a Calculated column in the front end=
Group A =
var Namecur = [Name] --Current Name
var grouphigh = COUNTROWS(FILTER(List, Table[Group] = "A" && List[Name] = Namecur ))
return
if(
grouphigh > 0, "Group A", "non Group A")
- Tito2 years agoHelper IV
Hello,
it worked. Thank you very much!
Best regards
Tito- SamWiseOwl2 years agoSuper User
Tito fantastic! If you could mark it as a Solution I'd appreciate it!
You already did, thank you so much 🙂
- Tito2 years agoHelper IV
Hello SamWiseOwl ,
can we make this calculated column dynamic. So if I select group A, it should return "group A", otherwise "non group A". And if I select group B, it should return "group B", otherwise "non group B" etc.
Thanks!- SamWiseOwl2 years agoSuper User
Hi Tito
Sadly calculated columns cannot be made dynamic.
They are only recalculated when the data is refreshed.
- Tito2 years agoHelper IV
Hello SamWiseOwl
I tried it, but it didn't work.
Group dynamic =var _Group = SELECTEDVALUE(Tabelle[Group])var Namecur = [Name] --Current Namevar grouphigh = COUNTROWS(FILTER(Tabelle, Tabelle[Group] = _Group && Tabelle[Name] = Namecur ))returnif(grouphigh > 0, "Group " & _Group, "non Group " & _Group )