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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
jmsny
Frequent Visitor

Filter on Visual Row Context

Hi,

I'm working on a table that needs to show every name on a list and corresponding data, even when being filtered.  For example:

 

NameData
Name 11
Name 22
Name 33

 

That is how it shows when all names are selected, and is supposed to show always.  However, what is currently happening when a name is selected is this:

NameData
Name 1 
Name 22
Name 3 

 

Simplifying the parameter as a count, this is basically what I've done for the data column:

 

CALCULATE(COUNT('Table'[Data]),
FILTER(ALL('Table'),'Table'[Name]=SELECTEDVALUE('Table'[Name])))

 

Which doesn't work.
If I filter on a different variable instead of SELECTEDVALUE for Name, it populates the entire table, but without row-specific values:
NameData
Name 16
Name 26
Name 36
 
How can I have it show all data and filter based on the row in the visual?

 

1 ACCEPTED SOLUTION


@Ashish_Mathur wrote:

Hi,

Simplify your measure to

=COUNT('Table'[Data])


@SamInogic wrote:

Hi,

 

As per understanding to are attempted to achieve is to always display all names in the visual, while the Data column still shows the correct value for each row, even when a slicer filters one name.

The issue occurs because SELECTEDVALUE('Table'[Name]) is affected by the slicer context, which removes other names from the filter context. As a result, only the selected name returns data while the others appear blank.

Recommended Approach

Instead of using SELECTEDVALUE, remove the slicer filter on Name while keeping the row context from the visual.

You can modify the measure like this:

Data Measure =
CALCULATE(
COUNT('Table'[Data]),
REMOVEFILTERS('Table'[Name])
)

 

This Works Because

REMOVEFILTERS('Table'[Name]) removes the slicer filter on the Name column.
• The row context from the table visual still applies, so each row calculates its own value.
• This allows the visual to display all names with their corresponding data, even when a slicer selection exists.

 

Hope this helps.

 

Thanks!


 

No, these are the opposite of what I wanted to do, and the second one smells like AI.

 

 

I already mentioned what ended up working a few comments ago, but this is the DAX:

 

CALCULATE(COUNT('Table'[Data]),
FILTER(ALL('Helper Table'),'Helper Table'[Name]=SELECTEDVALUE('Table'[Name])))

 

The Helper Table is connected to the original table by Name and Helper Table[Name] was in the slicer.

 

View solution in original post

9 REPLIES 9
cengizhanarslan
Super User
Super User

1) Create a disconnected Name table

Name Slicer =
DISTINCT ( DimName[Name] ) 

Do not create a relationship from Name Slicer to your model.

 

2) Use fields like this

Table visual rows: DimName[Name] (the “real” name dimension that drives the rows)

Slicer: Name Slicer[Name]

 

3) Measure (filters data using the slicer, but keeps all rows)

Data Count :=
VAR SelNames = VALUES ( 'Name Slicer'[Name] )
RETURN
IF (
    ISFILTERED ( 'Name Slicer'[Name] ),
    CALCULATE (
        COUNT ( Fact[Data] ),               
        TREATAS ( SelNames, DimName[Name] ) 
    ),
    COUNT ( Fact[Data] )
)

 

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.


@Ashish_Mathur wrote:

Hi,

Simplify your measure to

=COUNT('Table'[Data])


@SamInogic wrote:

Hi,

 

As per understanding to are attempted to achieve is to always display all names in the visual, while the Data column still shows the correct value for each row, even when a slicer filters one name.

The issue occurs because SELECTEDVALUE('Table'[Name]) is affected by the slicer context, which removes other names from the filter context. As a result, only the selected name returns data while the others appear blank.

Recommended Approach

Instead of using SELECTEDVALUE, remove the slicer filter on Name while keeping the row context from the visual.

You can modify the measure like this:

Data Measure =
CALCULATE(
COUNT('Table'[Data]),
REMOVEFILTERS('Table'[Name])
)

 

This Works Because

REMOVEFILTERS('Table'[Name]) removes the slicer filter on the Name column.
• The row context from the table visual still applies, so each row calculates its own value.
• This allows the visual to display all names with their corresponding data, even when a slicer selection exists.

 

Hope this helps.

 

Thanks!


 

No, these are the opposite of what I wanted to do, and the second one smells like AI.

 

 

I already mentioned what ended up working a few comments ago, but this is the DAX:

 

CALCULATE(COUNT('Table'[Data]),
FILTER(ALL('Helper Table'),'Helper Table'[Name]=SELECTEDVALUE('Table'[Name])))

 

The Helper Table is connected to the original table by Name and Helper Table[Name] was in the slicer.

 

Kedar_Pande
Super User
Super User

@jmsny 

 

Use This:

Data Count = 
CALCULATE(
COUNT('Table'[Data]),
'Table'[Name] = MAX('Table'[Name])
)

If this answer helped, please click 👍 or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande

SamInogic
Solution Sage
Solution Sage

Hi,

 

As per understanding to are attempted to achieve is to always display all names in the visual, while the Data column still shows the correct value for each row, even when a slicer filters one name.

The issue occurs because SELECTEDVALUE('Table'[Name]) is affected by the slicer context, which removes other names from the filter context. As a result, only the selected name returns data while the others appear blank.

Recommended Approach

Instead of using SELECTEDVALUE, remove the slicer filter on Name while keeping the row context from the visual.

You can modify the measure like this:

Data Measure =
CALCULATE(
COUNT('Table'[Data]),
REMOVEFILTERS('Table'[Name])
)

 

This Works Because

REMOVEFILTERS('Table'[Name]) removes the slicer filter on the Name column.
• The row context from the table visual still applies, so each row calculates its own value.
• This allows the visual to display all names with their corresponding data, even when a slicer selection exists.

 

Hope this helps.

 

Thanks!

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/
danextian
Super User
Super User

Hi @jmsny 

 

Your measure doesn't work because it applies the same value for the whole of the table of the selected name. You can either remove the interaction or use a disconnected table.

danextian_0-1772686753371.png

Please see the attached pbix.

If this still doesn't work, please further elabarote your use case.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Ashish_Mathur
Super User
Super User

Hi,

Simplify your measure to

=COUNT('Table'[Data])

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
jmsny
Frequent Visitor

Update: the helper table I was using was the cause and solution of the problem.  I don't fully understand it since I tried both the original and helper tables as slicers, but the filter needs to be on the helper table and the selected value needs to be the original table.  It doesn't work the other way around even if the slicer is from the original table.

zenisekd
Super User
Super User

Please try out this:

 
Data Measure =
CALCULATE(
COUNT('Table'[Data]),
ALL('Table'[Name])
)
 
or
 
Data Measure =
CALCULATE(
COUNT('Table'[Data]),
REMOVEFILTERS('Table'[Name])
)

That does not work.  It's similar to what I mentioned at the end:

 

If I filter on a different variable instead of SELECTEDVALUE for Name, it populates the entire table, but without row-specific values

I don't want it to show the same value for every name, I want it to show individual values.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.