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! Request now

Reply
Anonymous
Not applicable

Keep a permanent row visible in a matrix even when filtering

Hi,

 

First post in the community after a lot lurking!

 

As stated in the subject I would like to be able to keep some rows in a matrix even if a slicer is currently filtering it.

So looking below I can see that BRAND H has Sales within CABRIO and SUV, with 50% share in the first and 100% share in the second. The objective is to be able to see also the rows for SEDAN and SPORT even if BRAND H has no sales whitin these two types (and thus 0% share) but still showing the correct brand share in CABRIO and SUV.

 

In brief, the slicer should be filtering only the brand share column (so dynamically change based on the selected brand).

 

JustBI_0-1611931320818.png

 

 

 

 

Thanks a lot for the help!

 

Best,

M.

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Anonymous,

 

Try this solution.

 

1. Create a table with car brands (one row per brand). No relationship exists between this table and the data table. One option is to create a calculated table as below:

 

CarBrands = DISTINCT ( CarSales[BRAND] )

 

2. Create a Brand slicer based on the table CarBrands.

 

3. Create measure:

 

Brand Share = 
VAR vSelBrand =
    SELECTEDVALUE ( CarBrands[BRAND] )
VAR vBrandSales =
    CALCULATE ( SUM ( CarSales[SALES BY TYPE] ), CarSales[BRAND] = vSelBrand )
VAR vTotalSales =
    SUM ( CarSales[SALES BY TYPE] )
VAR vResult =
    IF ( ISBLANK ( vBrandSales ), 0, DIVIDE ( vBrandSales, vTotalSales ) )
RETURN
    vResult

 

4. Create matrix. Interactions between the slicer and matrix should be enabled.

 

DataInsights_0-1612124717220.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
DataInsights
Super User
Super User

@Anonymous,

 

Try this solution.

 

1. Create a table with car brands (one row per brand). No relationship exists between this table and the data table. One option is to create a calculated table as below:

 

CarBrands = DISTINCT ( CarSales[BRAND] )

 

2. Create a Brand slicer based on the table CarBrands.

 

3. Create measure:

 

Brand Share = 
VAR vSelBrand =
    SELECTEDVALUE ( CarBrands[BRAND] )
VAR vBrandSales =
    CALCULATE ( SUM ( CarSales[SALES BY TYPE] ), CarSales[BRAND] = vSelBrand )
VAR vTotalSales =
    SUM ( CarSales[SALES BY TYPE] )
VAR vResult =
    IF ( ISBLANK ( vBrandSales ), 0, DIVIDE ( vBrandSales, vTotalSales ) )
RETURN
    vResult

 

4. Create matrix. Interactions between the slicer and matrix should be enabled.

 

DataInsights_0-1612124717220.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

@DataInsights 

Thanks a lot, this works perfectly!

@Anonymous,

 

Glad to hear that works. Here's a version of the measure that works for both single and multiple Brand slicer selections:

 

Brand Share = 
VAR vSelBrand =
    ALLSELECTED ( CarBrands[BRAND] )
VAR vBrandSales =
    CALCULATE ( SUM ( CarSales[SALES BY TYPE] ), CarSales[BRAND] IN vSelBrand )
VAR vTotalSales =
    SUM ( CarSales[SALES BY TYPE] )
VAR vResult =
    IF ( ISBLANK ( vBrandSales ), 0, DIVIDE ( vBrandSales, vTotalSales ) )
RETURN
    vResult

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.

Top Solution Authors