Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Reply
Syndicate_Admin
Administrator
Administrator

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 NameArticleDate
BorjaA01-Apr-22
JonA01-Apr-22
AsierA01-Apr-22
RicardoB01-Apr-22
IñakiC01-Apr-22
CristinaD01-Apr-22
GorkaC01-Apr-22
AsierA02-Apr-22
BorjaD02-Apr-22
CristinaB02-Apr-22
RicardoA02-Apr-22
IñakiB03-Apr-22
JonD03-Apr-22
CristinaB03-Apr-22
GorkaC03-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 NameArticleDate Number of times you have manufactured the item
BorjaA01-Apr-22 1
JonA01-Apr-22 1
AsierA01-Apr-22 2
RicardoB01-Apr-22 1
IñakiC01-Apr-22 1
CristinaD01-Apr-22 1
GorkaC01-Apr-22 2
AsierA02-Apr-22 2
BorjaD02-Apr-22 1
CristinaB02-Apr-22 2
RicardoA02-Apr-22 1
IñakiB03-Apr-22 1
JonD03-Apr-22 1
CristinaB03-Apr-22 2
GorkaC03-Apr-22 1

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

Greetings and thanks in advance.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new calculated column.

Jihwan_Kim_0-1663770154319.png

 

 

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.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new calculated column.

Jihwan_Kim_0-1663770154319.png

 

 

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.


Go to My LinkedIn Page


Thank you very much, it works perfectly!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.