Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have a table that looks something like this
Product
ProdA
ProdBProdA
ProdC
ProdDProdB
ProdE
I want to add a new column and set the value to GroupA if any of the row has ProdA in it, otherwise, I want to set it GroupOther.
My desired output is something like this
Product Group
ProdA GroupA
ProdBProdA GroupA
ProdC GroupOther
ProdE GroupOther
Please advise how to accomplish it
Thanks in advance
Solved! Go to Solution.
Try to add a new column like this:
Group =
IF (
ISERROR ( SEARCH ( "ProdA", yourTable[Product] ) ),
"GroupOther",
"GroupA"
)
Hi @talhaparvaiz ,
You can use the following measure:
Group = var test1=FIND("ProdA",MAX('Table'[Product ]),,0) return IF(test1=0,"GroupOther","GroupA")
Then you will see the below:
Wish it is helpful for you!
Best Regard
Lucien Wang
Try to add a new column like this:
Group =
IF (
ISERROR ( SEARCH ( "ProdA", yourTable[Product] ) ),
"GroupOther",
"GroupA"
)
@talhaparvaiz , Create a new column like
Switch( True() ,
[Product] in {"ProdA","ProdBProdA"} ,"GroupA",
[Product] in {"ProdC","ProdE"} ,"GroupOther",
,"GroupOther"
)
Also check
https://www.youtube.com/watch?v=gelJWktlR80
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |