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
RichOB
Post Partisan
Post Partisan

Need a new column to count each combination

Hi, I need to make a summarized table and add a column to count the number of incidents for each combination.

 

The first table below is my original, the 2nd one is what I need it to look like. What DAX will add that column, please?

 

Incident TypeLocationDateFinancial Quarter
Missing personGlasgow02/08/2024Q2
Missing personGlasgow02/08/2024Q2
Medical concernGlasgow01/11/2024Q3
Missing personGlasgow01/11/2024Q3
Missing personGlasgow01/11/2024Q3
Medical concernEdinburgh02/08/2024Q2
Medical concernEdinburgh02/08/2024Q2
Missing PersonEdinburgh02/08/2024Q2
Medical concernEdinburgh01/11/2024Q3
Medical concernEdinburgh01/11/2024Q3
AggressionManchester02/08/2024Q2
AggressionManchester02/08/2024Q2
AggressionManchester01/11/2024Q3
AggressionManchester01/11/2024Q3
Medical concernManchester01/11/2024Q3

 

Incident Type Location Financial Quarter Count

Missing PersonGlasgowQ22
Missing PersonGlasgowQ33
Medical ConcernGlasgowQ31
Medical ConcernEdinburghQ22
Medical ConcernEdinburghQ32
AggressionManchesterQ22
AggressionManchesterQ32
Medical ConcernManchesterQ31

 

 

 

 

 

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

Thanks for the solution pborah  offered, and i want to offer some more information for user to refer to.

hello @RichOB , you can try the following two solutions.

1.If you need to create a summerized table, you can create a new calculated table.

Table2 =
SUMMARIZE (
    'Table',
    [Incident Type],
    'Table'[Location],
    'Table'[Financial Quarter],
    "Counts", COUNTROWS ( 'Table' )
)

Output

vxinruzhumsft_4-1733190017502.png

 

 

2.If you just want the counts you can refer the following sloutions:

Soluton1:

Create a calculated column.

 

Counts =
COUNTROWS (
    FILTER (
        'Table',
        [Incident Type] = EARLIER ( 'Table'[Incident Type] )
            && [Location] = EARLIER ( 'Table'[Location] )
            && [Financial Quarter] = EARLIER ( 'Table'[Financial Quarter] )
    )
)

 

Output

vxinruzhumsft_2-1733189710455.png

Solution2: Create a measure. and put the measure to the visual.

 

Measure = COUNTROWS('Table')

 

 Output

vxinruzhumsft_3-1733189737794.png

Best Regards!

Yolo Zhu

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

4 REPLIES 4
Anonymous
Not applicable

Hi,

Thanks for the solution pborah  offered, and i want to offer some more information for user to refer to.

hello @RichOB , you can try the following two solutions.

1.If you need to create a summerized table, you can create a new calculated table.

Table2 =
SUMMARIZE (
    'Table',
    [Incident Type],
    'Table'[Location],
    'Table'[Financial Quarter],
    "Counts", COUNTROWS ( 'Table' )
)

Output

vxinruzhumsft_4-1733190017502.png

 

 

2.If you just want the counts you can refer the following sloutions:

Soluton1:

Create a calculated column.

 

Counts =
COUNTROWS (
    FILTER (
        'Table',
        [Incident Type] = EARLIER ( 'Table'[Incident Type] )
            && [Location] = EARLIER ( 'Table'[Location] )
            && [Financial Quarter] = EARLIER ( 'Table'[Financial Quarter] )
    )
)

 

Output

vxinruzhumsft_2-1733189710455.png

Solution2: Create a measure. and put the measure to the visual.

 

Measure = COUNTROWS('Table')

 

 Output

vxinruzhumsft_3-1733189737794.png

Best Regards!

Yolo Zhu

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

 

 

pborah
Solution Sage
Solution Sage

@RichOB you need to create sort of unique keys for each combination of incident type, location, and financial quarter. It could be as simple as creating a column concatenating those three values, usually something like-

 

New Field = IncidentType&Location&Quarter

 

Then you can drop that calculated column in your "columns" card if you're using a table visual and set that column to count.

Hi @pborah thanks for replying, I've made the unique keys using your suggestion, but would you know how to get the numbers in the table column instead of setting the visual to "count"? I need to use table column to make a lot of mesures. Sorry should have mentioned that. Thanks again!

hey @RichOB , no problem. Can you perhaps respond with a desired output with all your measures? Please check the screenshot below for how to get the counts. After setting the UniqueKey field to count, I renamed that to display as QuarterCount. Feel free to shoot any further questions if needed.

 

pborah_0-1733158962611.png

 

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.

Top Kudoed Authors