dee
dee

Reputation: 147

Power BI - How to return data set with certain condition

Is there a way to return the data set if the value on one of the columns (Animal) appears more than once, within PowerQuery?

For example, this is the data set.

Set1

I want the outcome to be like this.

enter image description here

Is this possible? Basically if any count of animal is < 2, then it would not show up on the outcome.

Upvotes: 0

Views: 94

Answers (1)

Agustin Palacios
Agustin Palacios

Reputation: 1204

Create a new step and use the following function:

= Table.SelectRows(YourSource, each Table.Contains(Table.SelectRows(Table.Group(YourSource, {"Animal"}, {{"Count", each Table.RowCount(_), Int64.Type}}), each ([Count] > 1)),_,{"Animal"}))

Remember to change the YourSource statements for your previous step name or source. Hope it helps.

Upvotes: 1

Related Questions