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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

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
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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