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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Edmundas
Frequent Visitor

Simple countif

Hi everyone,

 

I'm quite new on Power BI. Could you please help me to write formula in Power BI column (COUNTIF formula in picture below). Thank you in advance.

 

Countif.jpg

2 ACCEPTED SOLUTIONS
BeaBF
Super User
Super User

@Edmundas Hi!

 

= CONTAINS('Table','Table'[Random names], 'Table'[Employee]) + 0
 
BBF

View solution in original post

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1668591481579.png

 

 

Expected result CC =
COUNTROWS (
    SUMMARIZE (
        FILTER (
            Data,
            Data[Employee] = EARLIER ( Data[Employee] )
                && Data[Employee] IN DISTINCT ( Data[Random name] )
        ),
        Data[Employee]
    )
) + 0

 

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

4 REPLIES 4
Edmundas
Frequent Visitor

Thanks guys, both formulas worked!!!

@Edmundas However, I advise you to adopt mine, as it is computationally lighter.

 

BBF

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1668591481579.png

 

 

Expected result CC =
COUNTROWS (
    SUMMARIZE (
        FILTER (
            Data,
            Data[Employee] = EARLIER ( Data[Employee] )
                && Data[Employee] IN DISTINCT ( Data[Random name] )
        ),
        Data[Employee]
    )
) + 0

 

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.

BeaBF
Super User
Super User

@Edmundas Hi!

 

= CONTAINS('Table','Table'[Random names], 'Table'[Employee]) + 0
 
BBF

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.