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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Craigja123
Helper I
Helper I

How to default a line chart to 1st item in a table

I have a table with a large number of stocks/shares and a line chart based off of this showing the % holding of each stock over time.  The issue (which to me is a non-issue!) is that when the PowerBI loads, as no stock is selected in the table, the line chart then shows all stocks and is a complete mess with hundres of lines all different colours, the fix of course, is the user just clicks a stock in the table and its sorted but they dont want to do that!  They want it to default to the top stock in the list on openeing, with the ability to click on others stocks to show those holding when they use the report.  Any ideas? 🙂

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

Thanks for the solution Selva-Salimi offered, and i want to offer some more information for user to refet to.

hello @Craigja123 , you can use the pre-selected slicer visual,  you can refer to the following sample.

Sample data

vxinruzhumsft_0-1727062072736.png

1.Create a true/false table.

vxinruzhumsft_1-1727062107448.png

2.Add the pre-selected slicer.

vxinruzhumsft_2-1727062150381.png

3.Create a rank measure first.

Rank = RANKX(ALLSELECTED('Table'[Type]),CALCULATE(SUM('Table'[value])),,DESC)

4.Create a preselect measure.

Preselect = IF([Rank]=1,TRUE(),FALSE())

5.Put the following field to the preselected visual.

vxinruzhumsft_3-1727062256710.png

Then it will preselect the top1 type.

Output

vxinruzhumsft_4-1727062296875.png

If you want to display all, you can select all.

vxinruzhumsft_5-1727062322737.png

If you want to display only top1, you just need to reset the slicer.

 

Best Regards!

Yolo Zhu

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
Craigja123
Helper I
Helper I

Perfect!  I couldnt work out how to get the pre selected slicer to work

Anonymous
Not applicable

Hi,

Thanks for the solution Selva-Salimi offered, and i want to offer some more information for user to refet to.

hello @Craigja123 , you can use the pre-selected slicer visual,  you can refer to the following sample.

Sample data

vxinruzhumsft_0-1727062072736.png

1.Create a true/false table.

vxinruzhumsft_1-1727062107448.png

2.Add the pre-selected slicer.

vxinruzhumsft_2-1727062150381.png

3.Create a rank measure first.

Rank = RANKX(ALLSELECTED('Table'[Type]),CALCULATE(SUM('Table'[value])),,DESC)

4.Create a preselect measure.

Preselect = IF([Rank]=1,TRUE(),FALSE())

5.Put the following field to the preselected visual.

vxinruzhumsft_3-1727062256710.png

Then it will preselect the top1 type.

Output

vxinruzhumsft_4-1727062296875.png

If you want to display all, you can select all.

vxinruzhumsft_5-1727062322737.png

If you want to display only top1, you just need to reset the slicer.

 

Best Regards!

Yolo Zhu

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

 

Selva-Salimi
Super User
Super User

Hi @Craigja123 

 

you can save and upload your dashboard on the first ranked stock selection so when the end user open the dashboard they always see one stock and can select any stock they prefer.

 

as the first stock might be dynamically changed. then write a measure using "Rankx" to find top 1.

 

If this post helps, then I would appreciate a thumbs up  and mark it as the solution to help the other members find it more quickly. 

 

@Craigja123 

 

Another easy solution is to create a column and rank your stock based on the value as follows:

 

ranked_column = RANKX('your_Table','your_Table'[value],,DESC)

 

and then create another table which contain just number "1" and relate these two tables to each other and create an slicer in the dashboard. when end user select the slicer they can see first ranked stock (default setting) and when unselected they can see all.

 

If this post helps, then I would appreciate a thumbs up  and mark it as the solution to help the other members find it more quickly. 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors