Forum Discussion
Grouping Values together in IF statement
Hi LyonsBI_BRL ,
Here are the steps you can follow:
1. Create measure.
Flag =
var _table=SUMMARIZE(ALL('Query1'),[Segement Group],[of Units],"1",[MegaDeals_New])
var _max=MAXX(FILTER(_table,[1]=[MegaDeals_New]),[of Units])
return
IF(MAX([of Units])=_max,1,0)
2. Place the Flag in the Filter, set is =1, Apply filter.
3. Result.
Only one in the same group
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- LyonsBI_BRL5 years agoHelper III
Anonymous
I tried the solution you posted last Friday
Flag = var _table=SUMMARIZE(ALL('Query1'),[Segement Group],[of Units],"1",[MegaDeals_New]) var _max=MAXX(FILTER(_table,[1]=[MegaDeals_New]),[of Units]) return IF(MAX([of Units])=_max,1,0)However when I placed it into the table, it actually cleared everything and didn't display anything. Does it Matter if it's Summarize of Segment Group or can it also be Summarize of Business Type or Organization (the name of the Company)
Thanks!
- LyonsBI_BRL5 years agoHelper III
Anonymous
So I put together the
Flag = var _table=SUMMARIZE(ALL('Query1'),[Segment Group],[[Units]]],"1",[MegaDeals_New]) var _max=MAXX(FILTER(_table,[1]=[MegaDeals_New]),[[Units]]]) return IF(MAX([[ST Units]]])=_max,1,0)Though it wasn't seeming like it was grouping together when I placed the Flag Measure into the table. Instead it just took a huge amount of time and swtiched from being Flag = 1 to showing as 0 in the data card.
Am I missing something here?