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
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
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.