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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Memorable Member
Memorable Member

@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
Memorable Member
Memorable Member

@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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.