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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Count of duplicates above a certain value

Hi everyone! I need help with a chart that shows how many times a person worked less than 2 times on a month but more than 0. The database looks like this:

ID   Date              Month
1    1-1-2019       Jan
1    1-2-2019       Jan
1    20-2-2019     Feb
2    10-1-2019     Feb
2    15-2-2019     Feb
2    15-3-2019     Mar
3    1-3-2019       Mar

3    2-3-2019       Mar

3   3-3-2019        Mar


The table shows the ID of the person and the date and month when the person worked. So, if I have a chart with "Number of persons v/s Months" the table of this chart would be:

Month | Number of persons
Jan         2 
Feb        1
Mar       1

Still don't know how to make this count,

Thank you for your time,
Best regards,
Gabriela

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

Try the following code for a measure:

 

Count below 2 times =
COUNTROWS (
    FILTER (
        SUMMARIZE ( Table; Table[Month]; Table[ID]; "CountID"; COUNT ( Table[ID] ) );
        [CountID] < 2
    )
)

Regards.

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
MFelix
Super User
Super User

Hi @Anonymous ,

 

Try the following code for a measure:

 

Count below 2 times =
COUNTROWS (
    FILTER (
        SUMMARIZE ( Table; Table[Month]; Table[ID]; "CountID"; COUNT ( Table[ID] ) );
        [CountID] < 2
    )
)

Regards.

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi @MFelix exactly that's the solution! thanks a lot! 🙂
I'd appreciate if you could help me with a little detail: ¿how can I show 0 on the months I have 0? because now the months with 0 just disappear from the visual and I want them present but with a bar on 0 level, is that possible?

Best regards,
Gabriela

Hi @Anonymous 

 

Try to add +0 to the measure.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Excellent! Thanks@MFelix !! I made such a big bypass to solve it haha now It looks like it should,

Have a great week 🙂
Gabriela

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors