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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Get total of category without showing category

Hi everyone,

 

I am stuck with a measure that should display the total of IDs for each category, but without showing the category.

Currently, I am able to display the column "Total ID by Country" using the following measure:

 

 

 

 

 

Total ID by Country = 
CALCULATE(
    COUNT(Mentions[ID]),
    ALLEXCEPT(
        Mentions,
        Market[Country]  // Dimension table
    )
)

 

 

 

 

 

IDCountryCount IDTotal ID by Country
1US13
2US13
3US13
4FR17
5FR17
6FR17
7FR17
8FR17
9FR17
10FR17

 

The problem is, as long as I remove the "Country" column, I get this result (column country should not be displayed):

IDCountryCount IDTotal ID by Country
1US110
2US110
3US110
4FR110
5FR110
6FR110
7FR110
8FR110
9FR110
10FR110

 

The goal is to get this (Country column should not be displayed):

IDCount IDTotal ID by Country
113
213
313
417
517
617
717
817
917
1017

 

I don't think I can use a calculated column as this measure is sliced by other dimensions then.

 

Many thanks in advance for your help.

 

1 ACCEPTED SOLUTION

It will be either this or something close to it (depending on which fields make up the table)

Total ID by Country = 
CALCULATE(
    COUNT(Mentions[ID]),
    FILTER(ALL(Mentions),
            Mentions[Country] = MAX(Mentions[Country] ) 
    )
)

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , I doubt that will work without a country in context. But try this

Total ID by Country = 
CALCULATE(
    COUNT(Mentions[ID]),
    filter(
        allselected(Mentions),
        Market[Country]  =max(Market[Country] ) // Dimension table
    )
)
Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandakThanks for your answer.

 

Unfortunately, it does not solve my problem.

It will be either this or something close to it (depending on which fields make up the table)

Total ID by Country = 
CALCULATE(
    COUNT(Mentions[ID]),
    FILTER(ALL(Mentions),
            Mentions[Country] = MAX(Mentions[Country] ) 
    )
)
Anonymous
Not applicable

@HotChilli many thanks, it works!

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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