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
Syndicate_Admin
Administrator
Administrator

Constant Line Per Filter

Good afternoon

I have a dashboard where I show the progress of enrollment according to the business line filter.

As you can see, I have 3 constant lines to the x-axis M1, M2 and M3 which have to disappear according to the filter, that is, if I select high school only M1 and M3 are shown or if I select graduate only M3 appears.

I haven't been able to get to the right conditional, you will have some example of how I can do it.

I would be very grateful.

MarckFC_0-1704931756341.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Syndicate_Admin ,

Based on the information you have provided, you can follow the steps below:
1. Create a table as a slicer.

vyifanwmsft_0-1705914752447.png

vyifanwmsft_1-1705914873702.png

 

2.Add new measures.

 

graduate = 
IF ( SELECTEDVALUE ( Table2[Select] ) = "graduate", [sales_], BLANK () )
high school1 = 
IF ( SELECTEDVALUE ( Table2[Select] ) = "high school", [number_], BLANK () )
high school2 = 
IF ( SELECTEDVALUE ( Table2[Select] ) = "high school", [sales_], BLANK () )

 

 

3.Put measures into the y-axis.

vyifanwmsft_2-1705915004232.png

Final output:

vyifanwmsft_3-1705915126554.png

vyifanwmsft_4-1705915145126.png

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

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

3 REPLIES 3
Anonymous
Not applicable

Hi @Syndicate_Admin ,

Based on the information you have provided, you can follow the steps below:
1. Create a table as a slicer.

vyifanwmsft_0-1705914752447.png

vyifanwmsft_1-1705914873702.png

 

2.Add new measures.

 

graduate = 
IF ( SELECTEDVALUE ( Table2[Select] ) = "graduate", [sales_], BLANK () )
high school1 = 
IF ( SELECTEDVALUE ( Table2[Select] ) = "high school", [number_], BLANK () )
high school2 = 
IF ( SELECTEDVALUE ( Table2[Select] ) = "high school", [sales_], BLANK () )

 

 

3.Put measures into the y-axis.

vyifanwmsft_2-1705915004232.png

Final output:

vyifanwmsft_3-1705915126554.png

vyifanwmsft_4-1705915145126.png

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Syndicate_Admin , In constant line you can use measure using Fx.

 

You can use a measure like

 

if(selectedvalue(Table[Enrollment])  ="School", 50, blank())

 

Blank will make line to disappear

 

You can also consider isfiltered and hasonevalue

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
Ritaf1983
Super User
Super User

Hi @Syndicate_Admin 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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.