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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Thank you very much, it works perfectly!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.