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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
FotFly
Helper II
Helper II

Selected value from table gets changed on selection

Hi all,

In my model I have 6 tables. All contain information about Clients and revenue. There is a main table with all clients and the others contain a subset of the main clients broken down into 5 categories (clients may overlap in tables). Each one of the five tables connects to the main table via the client name. I have created 6 table visuals to present the information and I have created a few measures that should be calculated in all tables but the columns used should be changed based on the visual we are in. For this I have created another table with only five rows which I use as a filter on this visual (selecting each time the table name) to indicate in a switch expression which column to select. So all of my measure look like this


Revenue
=

 

SWITCH(
    SELECTEDVALUE(TablePresented[Value]),
    "Main",
    SUM(MainTable[Revenue]),
    "Product1",
    SUM(Product1[Revenue]),
    "Product2",
    SUM(Product2[Revenue]),
    "Product3",
    SUM(Product3[Revenue]),
    "Product4",
    SUM(Product4[Revenue]),
    "Product5",
    SUM(Product5[Revenue])
)

This works fine until I click on a visual to filter the others for the selected client. Then the measure only gets calculated for the selected table and on the others they appear blank. I run a test with a card visual to get what happens to "TablePresented[Value]" if I set it as a filter on visual and it seems like the table returns me blank value since it gets filter to the selected table on each own and stops being the selected value.
Do you have any idea why this happens and whether I could fix it?
2 REPLIES 2
Kedar_Pande
Super User
Super User

When you filter by a client, the measure evaluates only the selected table and returns blank for others, as the filter context from TablePresented[Value] conflicts with the other visuals.

 

Update your measure as follows:

Revenue =
SWITCH(
TRUE(),
ISFILTERED(MainTable[Client Name]), SUM(MainTable[Revenue]),
ISFILTERED(Product1[Client Name]), SUM(Product1[Revenue]),
ISFILTERED(Product2[Client Name]), SUM(Product2[Revenue]),
ISFILTERED(Product3[Client Name]), SUM(Product3[Revenue]),
ISFILTERED(Product4[Client Name]), SUM(Product4[Revenue]),
ISFILTERED(Product5[Client Name]), SUM(Product5[Revenue]),
BLANK()
)

 

This approach ensures client selections work correctly for all visuals, avoiding blanks.

 

Your Kudos/Likes are much appreciated!
If this post helps, please consider Accepting it as the solution to help the other members find it more quickly.
Regards,
Kedar Pande
www.linkedin.com/in/kedar-pande

Thank you for you answer.

 

With this approach I have the same client filtered in all tables presenting the total revenue value from the main table when it should be calculating the specific product revenue based on the column selected. That means that each time the MainTable[Client] column is filtered and I get wrong results.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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