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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

Matrix Visual Total Only at First Row

Hi Friends,

 

Currently i have created a Matrxi visual using the 3 dimension columns and 1 fact column and the result is below.

vjeevanay_0-1729166068907.png

I am faicng unique situation where i need to show the total only at the first row of the category level. Something like the below.

vjeevanay_1-1729166194293.png

Note: I dont want to use row totals.
Please suggest me some ideas.
@amitchandak @Ritaf1983 @Greg_Deckler @ChandeepChhabra @GilbertQ @dbeavon3 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file(see the attachment), please check if that is what you want.

Measure = 
VAR _category =
    SELECTEDVALUE ( 'Table'[Product Category] )
VAR _subcategory =
    SELECTEDVALUE ( 'Table'[Product Sub Category] )
VAR _product =
    SELECTEDVALUE ( 'Table'[Product Name] )
VAR _minsubcat =
    CALCULATE (
        MIN ( 'Table'[Product Sub Category] ),
        ALLEXCEPT ( 'Table', 'Table'[Product Category] )
    )
VAR _minpro =
    CALCULATE (
        MIN ( 'Table'[Product Name] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Product Category] = _category
                && 'Table'[Product Sub Category] = _minsubcat
        )
    )
RETURN
    IF (
        _subcategory = _minsubcat
            && _product = _minpro,
        CALCULATE (
            SUM ( 'Table'[Sales] ),
            ALLEXCEPT ( 'Table', 'Table'[Product Category] )
        )
    )

vyiruanmsft_0-1729668220582.png

Best Regards

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file(see the attachment), please check if that is what you want.

Measure = 
VAR _category =
    SELECTEDVALUE ( 'Table'[Product Category] )
VAR _subcategory =
    SELECTEDVALUE ( 'Table'[Product Sub Category] )
VAR _product =
    SELECTEDVALUE ( 'Table'[Product Name] )
VAR _minsubcat =
    CALCULATE (
        MIN ( 'Table'[Product Sub Category] ),
        ALLEXCEPT ( 'Table', 'Table'[Product Category] )
    )
VAR _minpro =
    CALCULATE (
        MIN ( 'Table'[Product Name] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Product Category] = _category
                && 'Table'[Product Sub Category] = _minsubcat
        )
    )
RETURN
    IF (
        _subcategory = _minsubcat
            && _product = _minpro,
        CALCULATE (
            SUM ( 'Table'[Sales] ),
            ALLEXCEPT ( 'Table', 'Table'[Product Category] )
        )
    )

vyiruanmsft_0-1729668220582.png

Best Regards

Idrissshatila
Super User
Super User

hello @Anonymous ,

 

yes try the following but fill in with your field and table names

Sales = 
IF (
    ISINSCOPE('Table'[Product Name]),
    BLANK(),  -- For Product Names, show nothing
    IF (
        ISINSCOPE('Table'[Product Sub Category]),
        BLANK(),  -- For Sub Categories, show nothing
            [TotalSales]
        )  -- Show total at Product Category level
    )
)


Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Anonymous
Not applicable

Hi @Idrissshatila,

This wont work becasue the moment first condition satisfies 

IF (
ISINSCOPE('Table'[Product Name]),
BLANK(),  

It wont go to the next set of IF conditions.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors