cancel
Showing results for
Did you mean:
Highlighted
Established Member

## Assign Value based on other Values in the Group

Here is the situation, i have below table. You see, I have groups and it has different scores.  I need to find a way to assign a value i.e. ">50" or "<50" based on values in the group.

Example:

Group A contains Scores like, 42,49,55 - in this, i need to look for any value which is greater than 50, if it is there, the entire group will be assiged a value as ">50"

 Ticket Group Score 12453 A 42 12477 A 49 12501 A 55 12525 B 45 12549 B 60 12573 B 54 12597 C 62 12621 C 12 12645 C 45 12669 C 45 12693 D 80 12717 E 45 12741 E 45 12765 E 82 12789 F 45 12813 F 24

Result Expecting:

 Ticket Group Score Result 12453 A 42 >50 12477 A 49 >50 12501 A 55 >50 12525 B 45 >50 12549 B 60 >50 12573 B 54 >50 12597 C 62 >50 12621 C 12 >50 12645 C 45 >50 12669 C 45 >50 12693 D 80 >50 12717 E 45 <50 12741 E 45 <50 12765 E 82 >50 12789 F 45 <50 12813 F 24 <50

anyway to do this in PowerBI?

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: Assign Value based on other Values in the Group

Hey,

given your sample data, I do not understand your expected result for group E

There is a value 82 for ticket 12765, for this reason I would expect that the whole group E is marked with >50.

I guess this DAX statement can be used to create a calculated column:

```bin Score =
CALCULATE(
IF(MAX('Table1'[Score])>50,">50","<50")
,ALLEXCEPT('Table1',Table1[Group])
) ```

This creates the following

Hope this helps

Regards

Tom

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
2 REPLIES 2
Super User

## Re: Assign Value based on other Values in the Group

Hey,

given your sample data, I do not understand your expected result for group E

There is a value 82 for ticket 12765, for this reason I would expect that the whole group E is marked with >50.

I guess this DAX statement can be used to create a calculated column:

```bin Score =
CALCULATE(
IF(MAX('Table1'[Score])>50,">50","<50")
,ALLEXCEPT('Table1',Table1[Group])
) ```

This creates the following

Hope this helps

Regards

Tom

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
Established Member

## Re: Assign Value based on other Values in the Group

Perfect.

Thank you so much.