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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

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
    )
)
Share with Power BI Enthusiasts: 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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.