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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Count Measure based on all filters or columns except one

So I've got a table looking something like this that lists communications that have been sent and via what method

 

Customer ID MessageDelivery Method Sent Time
1Welcome EmailAM
1WelcomeLetterAM
2WelcomeEmailPM
3CongratsLetterAM
3CongratsEmailPM
3CongratsLetterAM

 

What I want is to put it into a table like this in a Power BI report

 

Customer ID MessageDelivery Method Count Sent Count Sent any Delivery Method 
1Welcome Email12
1WelcomeLetter12
2WelcomeEmail11
3CongratsLetter23
3CongratsEmail13

 

Now the first 4 columns are easy, but what I need is a measure for the last column. I need it as a measure as I would like it to work with filters. For example if I filtered to just PM, then the value should update.

 

The difficulty I'm having is that it's easy to count all rows. I can even count all rows that match just the customer ID and Message, but what I can't do is count all rows that match everything (those two columns plus any applied filters) regardless of the delivery method column.

 

Any help would be appreciated, thanks.

 

Edit: can't get the table to display correectly. It looks correct when I edit the post and if I try and change the column width I get an error saying invalid html

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can create a measure like

Count sent any delivery method =
CALCULATE (
    COUNTROWS ( 'Table' ),
    ALLEXCEPT ( 'Table', 'Table'[Delivery method] )
)

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

You can create a measure like

Count sent any delivery method =
CALCULATE (
    COUNTROWS ( 'Table' ),
    ALLEXCEPT ( 'Table', 'Table'[Delivery method] )
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.