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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
v-pussah
Microsoft Employee
Microsoft Employee

Dynamic Column values based on Slicer Selection

Looking for a solution for the below given problem:-

 

I have a around 12 columns in a dataset which are plotted in a line chart. Out of this 8 are P1 and 4 are P2 category.

 

I need to slice these value sin line chart based on the categories (P1 and P2) in such a way that it only shows 4 P2 on selection of P2 or vice-versa.

 

I created a custom table with 2 columns having features and categories and wrote Switch statement on the selected value, but it’s not working.

 

Selection = SWITCH(TRUE(),

SELECTEDVALUE('Feature Selection'[Features]) = "ThirdPartyActiveUsage", SUM(TenantData[Third Party Active Usage]),

SELECTEDVALUE('Feature Selection'[Features]) = "CAActiveUsage", SUM(TenantData[CA Active Usage]),

SELECTEDVALUE('Feature Selection'[Features]) = "AppProxyActiveUsage", SUM(TenantData[AppProxy Active Usage])

)

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@v-pussah 

 

You may aslo try Unpivot Columns in Query Editor, then take advantage of the Legend field.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@v-pussah 

 

You may aslo try Unpivot Columns in Query Editor, then take advantage of the Legend field.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Unpivoting is the solution, but the problem is size of data. by unpivoting it has 25M rows.

Anonymous
Not applicable

Hello @v-pussah ,

I think you can use the bookmark function to do it.

Create two tables, one for P1, one for P2, and create two markers for these two tables.

Next, create a column with two values, such as: P1 and P2.

Click P1 for bookmarks, P2 for markers, and for the button, you can use force selection.

Please try.

Aiolos Zhao

amitchandak
Super User
Super User

@v-pussah,The information you have provided is not making the problem clear to me. Can you please explain with an example. Can you share sample data and sample output.

Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.