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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors