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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
EricKautz
Helper I
Helper I

Unique count of values in one column based on if greater than in another column

I have a report that has a column of ID's that are replicated and another column that tells me the days past due for each. I need a distinct count IDs that are greater than 4 days. Below is my sample data. I just need the total counts so in this case, only 2 IDs would be past 4 days and the figure to display in the card is 2.

 

IDDays Past Due

12345

10
1234510
111113
222226
222226
222226
1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @EricKautz 

You can use :

Up_to_4 = CALCULATE(DISTINCTCOUNT('Table'[ID]),'Table'[Days Past Due]>4)
Ritaf1983_0-1722617865988.png

Bbix is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

5 REPLIES 5
Ritaf1983
Super User
Super User

Hi @EricKautz 

You can use :

Up_to_4 = CALCULATE(DISTINCTCOUNT('Table'[ID]),'Table'[Days Past Due]>4)
Ritaf1983_0-1722617865988.png

Bbix is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

This worked perfectly thank you.

Happy to help 🙂

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
MNedix
Super User
Super User

Hi,

There isn't too much data to work with, I assume that 111113 is the only one which is not past due date by 4 days.

If this is the case then you can do something like this:

Past Due Date = CALCULATE(DISTINCTCOUNT(Table[ID]),DATEADD('Date'[Date],-4,DAY)

 

If this solved your question then please mark it as the solution so others can see it. A Kodos would also be very much appreciated.

Best,

 



If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,

Sorry, I didn't realize Microsoft cut off some data when I posted. The numbers you are seeing are the ID's and the days combined. so for the ones that are 12345 days should be 10, 11111 should be 3 days, and 22222 should be 6 days.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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