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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Gorloot
New Member

Count value occurences of a column group by the ID

Hi, 

 

Please see below for example,

 

I would like to create a measure that counts how many times equipment has a certain system fixed. 

The count can become larger/smaller by the date filter.  The counting should not be affected by the Work order Nbr.

The purpose is to see how many times that the same system repaired appears by equipment ID in a date range.

 

Thank you.

 

Equipment IDWork order NbrWO date createdSystem repairedexpected output : Count of system repaired 
1123452/9/2024Tire1
2123462/10/2024air condition3
2123331/10/2024air condition3
2123864/10/2024air condition3
2123462/10/2024plug2
2123553/10/2024plug2
3123472/10/2024light1
3123472/10/2024window1
4123482/13/2024window2
4123482/13/2024window2
4123482/13/2024Tire1
5123492/15/2024Engine3
5123492/15/2024Engine3
5123502/16/2024Engine3
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Gorloot 

 

Try the following measure:

 

Count of System Repaired = 
VAR _mindate = MIN('Table'[WO date created])
VAR _maxdate = MAX('Table'[WO date created])
RETURN
CALCULATE(
    COUNTA('Table'[System repaired]), 
    FILTER(ALLEXCEPT('Table', 'Table'[Equipment ID],'Table'[System repaired]), SELECTEDVALUE('Table'[WO date created])>= _mindate && SELECTEDVALUE('Table'[WO date created])<= _maxdate)
)

 

 

 

 

Best Regards,

Jayleny

 

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Gorloot 

 

Please try the following measure:

Count of System Repaired = 
CALCULATE(
    COUNTA('Table'[System repaired]), 
    ALLEXCEPT('Table', 'Table'[Equipment ID],'Table'[System repaired]),
    ALL('Table'[Work order Nbr])
)

 

Result:

vjialongymsft_0-1717637580736.png

 

 

 

 

 

 

Best Regards,

Jayleny

 

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

Hi @Anonymous ,

 

Thanks for quick response. I think this is very close to the solution.

 

However, I do have a bigger dataset and the measure is having a problem of grabbing other "System Repaired" counts from outside  "WO created" date range. 

 

I wish to grab the counts that are only limited to desired date range. 

 

Thank you again.

Anonymous
Not applicable

Hi @Gorloot 

 

Try the following measure:

 

Count of System Repaired = 
VAR _mindate = MIN('Table'[WO date created])
VAR _maxdate = MAX('Table'[WO date created])
RETURN
CALCULATE(
    COUNTA('Table'[System repaired]), 
    FILTER(ALLEXCEPT('Table', 'Table'[Equipment ID],'Table'[System repaired]), SELECTEDVALUE('Table'[WO date created])>= _mindate && SELECTEDVALUE('Table'[WO date created])<= _maxdate)
)

 

 

 

 

Best Regards,

Jayleny

 

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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