cancel
Showing results for
Did you mean:

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

## Count the number of times a value is repeated for 2 conditions

Hello, it is likely that there is some post where this topic has already been discussed, but after several days searching I have not found anything that has helped me to solve the problem.

I have a table where 3 columns appear (OPERATOR, MANUFACTURED ARTICLE AND DATE) as I show in the table below

 Operator Name Article Date Borja A 01-Apr-22 Jon A 01-Apr-22 Asier A 01-Apr-22 Ricardo B 01-Apr-22 Iñaki C 01-Apr-22 Cristina D 01-Apr-22 Gorka C 01-Apr-22 Asier A 02-Apr-22 Borja D 02-Apr-22 Cristina B 02-Apr-22 Ricardo A 02-Apr-22 Iñaki B 03-Apr-22 Jon D 03-Apr-22 Cristina B 03-Apr-22 Gorka C 03-Apr-22

I need to create a new attached column where I count the number of times that the operator has manufactured X article as I show below

 Operator Name Article Date Number of times you have manufactured the item Borja A 01-Apr-22 1 Jon A 01-Apr-22 1 Asier A 01-Apr-22 2 Ricardo B 01-Apr-22 1 Iñaki C 01-Apr-22 1 Cristina D 01-Apr-22 1 Gorka C 01-Apr-22 2 Asier A 02-Apr-22 2 Borja D 02-Apr-22 1 Cristina B 02-Apr-22 2 Ricardo A 02-Apr-22 1 Iñaki B 03-Apr-22 1 Jon D 03-Apr-22 1 Cristina B 03-Apr-22 2 Gorka C 03-Apr-22 1

I have tried in several ways with FUNCTIONS COUNT, SUMMARIZE, GROUPBY, FILTER...... but I can't visualize what I need.

1 ACCEPTED SOLUTION
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new calculated column.

``````Expected result CC =
COUNTROWS (
FILTER (
Data,
Data[Operator Name] = EARLIER ( Data[Operator Name] )
&& Data[Article] = EARLIER ( Data[Article] )
)
)
``````

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

2 REPLIES 2
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new calculated column.

``````Expected result CC =
COUNTROWS (
FILTER (
Data,
Data[Operator Name] = EARLIER ( Data[Operator Name] )
&& Data[Article] = EARLIER ( Data[Article] )
)
)
``````

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

Thank you very much, it works perfectly!