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
cksmth
Frequent Visitor

COUNTIFS to mark duplicates in PBI

Hi!

 

I am trying to replicate the below formula in Power BI. I am wanting to match the original use case which is to mark rows that are unique based off the criteria set. In this case the criteria are:

 

Column C = Project ID

Column S = Product Group

Column AY = Line Created Week

 

 

=IF(COUNTIFS(C$2:C2,C2,AY$2:AY2,AY2,S$2:S2,S2)=1,"X",IF(COUNTIFS(C$2:C2,C2,AY$2:AY2,AY2,S$2:S2,S2)>1,""))

 

Any help is appreaciated as this has me stumped! 🙂

2 ACCEPTED SOLUTIONS
Arul
Super User
Super User

@cksmth ,

try this calculated column,

Calculated Column= 
IF(
    COUNTROWS(
        FILTER(
            'YourTable',
            'YourTable'[Project ID] = EARLIER('YourTable'[Project ID]) &&
            'YourTable'[Product Group] = EARLIER('YourTable'[Product Group]) &&
            'YourTable'[Line Created Week] = EARLIER('YourTable'[Line Created Week])
        )
    ) = 1,
    "X",
    BLANK()
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


View solution in original post

v-xinruzhu-msft
Community Support
Community Support

Hi,

Thanks for the soltuion @Arul  provided, and i want to offer some more information for user to refer to.

hello @cksmth , you can refer to the following solution.

Column =
VAR a = [Project ID]
VAR b = [Project Group]
VAR c = [Line Created Week]
VAR d =
    COUNTROWS (
        FILTER (
            table,
            [Project ID] = a
                && [Project Group] = b
                && [Line Created Week] = c
        )
    )
RETURN
    SWITCH ( TRUE (), d = 1, "X", d > 1, BLANK () )

If the solutions @Arul  and i offered help you solve the problem, please consider to mark them as a solution.

 

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
cksmth
Frequent Visitor

Thank you both so much!

v-xinruzhu-msft
Community Support
Community Support

Hi,

Thanks for the soltuion @Arul  provided, and i want to offer some more information for user to refer to.

hello @cksmth , you can refer to the following solution.

Column =
VAR a = [Project ID]
VAR b = [Project Group]
VAR c = [Line Created Week]
VAR d =
    COUNTROWS (
        FILTER (
            table,
            [Project ID] = a
                && [Project Group] = b
                && [Line Created Week] = c
        )
    )
RETURN
    SWITCH ( TRUE (), d = 1, "X", d > 1, BLANK () )

If the solutions @Arul  and i offered help you solve the problem, please consider to mark them as a solution.

 

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Arul
Super User
Super User

@cksmth ,

try this calculated column,

Calculated Column= 
IF(
    COUNTROWS(
        FILTER(
            'YourTable',
            'YourTable'[Project ID] = EARLIER('YourTable'[Project ID]) &&
            'YourTable'[Product Group] = EARLIER('YourTable'[Product Group]) &&
            'YourTable'[Line Created Week] = EARLIER('YourTable'[Line Created Week])
        )
    ) = 1,
    "X",
    BLANK()
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.