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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

SWITCH(SELECTEDVALUE

Hi,

I am using dynamic stacked by.

I have created a column which takes user input and I use this value to stack by the 100% stacked bar chart.

I have two tables involved here:

The primary table from where the measure HC_HCorFTE_ED is coming, and I have a seperate table (Age_OrgTenure_PosTenure) to get the user inputs:

Age, Time in company and Time in role.

I do not have any relationship setup between these tables.

The problem is from the output of the below calculation, I always get the TimeInRoleGroups or whatever I put in the "else" part of the SWITCH statement.

Can anyone give me a clue what could be the reason ?

Thanks

Saniat_0-1654516526277.png

 

1 ACCEPTED SOLUTION
AntonioM
Solution Sage
Solution Sage

Hi, 

 

The problem is that the calculated column is calculated at refresh and then remains constant, independent of any filters in the report itself. That means no matter what changes your user makes (including selecting from slicers) the data in that column won't change.

 

As it ignores slicers, it's giving you the result for if there is no selectedvalue, so always the 'else' part. 

View solution in original post

1 REPLY 1
AntonioM
Solution Sage
Solution Sage

Hi, 

 

The problem is that the calculated column is calculated at refresh and then remains constant, independent of any filters in the report itself. That means no matter what changes your user makes (including selecting from slicers) the data in that column won't change.

 

As it ignores slicers, it's giving you the result for if there is no selectedvalue, so always the 'else' part. 

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.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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