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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
datadog_ab
Frequent Visitor

Count the presence of unique values in Item column based on Week

Below is the source coloumn and goal is to count 1 if the unique items for ID exceeds 2 over a week. Here in Week1 The unique items were 2 so it will be considered 0 and in week2 the unique items exceeded 2 and will be counted as 1. 

 

IDItemWeek
   
100ShoeWeek1
100T-ShirtWeek1
100T-ShirtWeek1
100T-ShirtWeek1
100ShoeWeek2
100T-ShirtWeek2
100CapWeek2
100ShoeWeek2
100BeltWeek2

 

So here unique items for ID exceeded in Week 2 So the result will be below

 

ID               Result

100                1

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@datadog_ab 

Create a measure as follows:

 

Result = 
COUNTROWS(
    FILTER(
        ADDCOLUMNS(
            SUMMARIZE( Table01 , Table01[Week] ),
            "@count" , CALCULATE( DISTINCTCOUNT( Table01[Item] ) )
        ),
        [@count] > 2
    )
)

 

Fowmy_0-1704829391086.png

 

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@datadog_ab 

Create a measure as follows:

 

Result = 
COUNTROWS(
    FILTER(
        ADDCOLUMNS(
            SUMMARIZE( Table01 , Table01[Week] ),
            "@count" , CALCULATE( DISTINCTCOUNT( Table01[Item] ) )
        ),
        [@count] > 2
    )
)

 

Fowmy_0-1704829391086.png

 

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

That did the trick. Kudos @Fowmy 

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.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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