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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Byzbkr
Frequent Visitor

Filtered Legends

Hi,

 

I want to create line chart and add specific one column as a legends also slicer choices. But charachter lengths varies in the column that I want to add.  However I just want to take the rows its length equals to 3. Both for legend and slicer. How can I do that?

 

Thanks.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Byzbkr ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want.

1. Create a measure as below to judge if the length of that column value is equal to 3

Flag = IF ( LEN ( SELECTEDVALUE ( 'Table'[category] ) ) = 3, 1, 0 )

2. Apply the visual-level filter for both the line chart and slicer with the condition(Flag is 1)

yingyinr_0-1646643551944.png

If my above understanding is wrong, please correct me. And later please share some sample data, backend logic and your expected result with special examples. Thank you.

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Byzbkr ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want.

1. Create a measure as below to judge if the length of that column value is equal to 3

Flag = IF ( LEN ( SELECTEDVALUE ( 'Table'[category] ) ) = 3, 1, 0 )

2. Apply the visual-level filter for both the line chart and slicer with the condition(Flag is 1)

yingyinr_0-1646643551944.png

If my above understanding is wrong, please correct me. And later please share some sample data, backend logic and your expected result with special examples. Thank you.

Best Regards

amitchandak
Super User
Super User

@Byzbkr , Not very clear. If you just want a three-digit from the current column name. You need to create a new column

 

example

3 char =  left([column],3)

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.