cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DanielaXavier28
Frequent Visitor

Line at axis X

Hi Guys

Someone can help me with this situation?

I need put one flexible line on the axis X, my axi X is made of hours, I would like to put one line.  If I select Contagem on the box , this line need stay at 9 PM,  if I select Belo Horizonte or Campinas the line need be at 3 PM.Captu hoje.pngCaptura de tela situação desejada.png

1 ACCEPTED SOLUTION
RicoZhou
Community Support
Community Support

Hi @DanielaXavier28 ,

 

According to your screenshot, I think you should use Line and clustered column chart to create a visual. It supports us to use "X-Axis Constant Line" in Analysis Pane.

Here is my Sample, data table Table1 and Table2 which is a calculated table with selections.

RicoZhou_0-1656662733019.png

Table 2 = {"Contagem","Belo Horizonte","Campinas"}

Measure:

Measure = 
VAR _SELECTVALUE = SELECTEDVALUE('Table 2'[Value])
RETURN
IF(_SELECTVALUE = "Contagem",TIME(21,0,0),IF( _SELECTVALUE IN {"Belo Horizonte","Campinas"},TIME(15,0,0))
)

You may refer to the offical blog which is shared by amitchandak to add this measure into "X-Axis Constant Line" in Analysis Pane.

RicoZhou_1-1656662776624.png

 Result is as below.

RicoZhou_2-1656662794154.png

RicoZhou_3-1656662801097.png

 

Best Regards,
Rico Zhou

 

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

2 REPLIES 2
RicoZhou
Community Support
Community Support

Hi @DanielaXavier28 ,

 

According to your screenshot, I think you should use Line and clustered column chart to create a visual. It supports us to use "X-Axis Constant Line" in Analysis Pane.

Here is my Sample, data table Table1 and Table2 which is a calculated table with selections.

RicoZhou_0-1656662733019.png

Table 2 = {"Contagem","Belo Horizonte","Campinas"}

Measure:

Measure = 
VAR _SELECTVALUE = SELECTEDVALUE('Table 2'[Value])
RETURN
IF(_SELECTVALUE = "Contagem",TIME(21,0,0),IF( _SELECTVALUE IN {"Belo Horizonte","Campinas"},TIME(15,0,0))
)

You may refer to the offical blog which is shared by amitchandak to add this measure into "X-Axis Constant Line" in Analysis Pane.

RicoZhou_1-1656662776624.png

 Result is as below.

RicoZhou_2-1656662794154.png

RicoZhou_3-1656662801097.png

 

Best Regards,
Rico Zhou

 

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

@DanielaXavier28 , You can create a measure using Switch, and then you can have those values. You can use that under X-axis Constant line under fx(Analytic Pane). But please note that is only supported for a few data types



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors