cancel
Showing results for 
Search instead for 
Did you mean: 
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 III
Super User III

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 III
Super User III

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

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
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors