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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
carlosflores
Helper I
Helper I

Scatter chart with hours as Y axis

Hello Community. I'm trying to make a scatter chart showing the employees in the X axis and the hours of the day in the Y axis so I can show the hour of arrival of each employee. I have a database like this:

 

pregunta1.PNG

 

I have created a Date table and an Hour table but for some reason, Power Bi won't let me put the hours in the Y axis. This is my hour table:

 

pregunta2.PNG

 

Adn this are my relationships:

 

pregunta3.PNG

 

I would really appreciate some help on this matter. Thanks in advance!

1 ACCEPTED SOLUTION

HI, @carlosflores

     For the values on the Y-axis have to be aggregated, you need to add a "type" for your basic data to classify these Time.

for example:

27.PNG

assume that:

A representative When they get in.

B representative When they go to lunch

C representative When they come back from lunch

D representative When they leave for the day.

 

then drag the field type into Legend values

Result:

28.PNG

here is pbix, please try it.

https://www.dropbox.com/s/9rm7g2gpsivty6p/Scatter%20chart%20with%20hours%20as%20Y%20axis02.pbix?dl=0

 

Best Regards,

Lin

 

Community Support Team _ Lin
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

7 REPLIES 7
carlosflores
Helper I
Helper I

@v-lili6-msft, thaks for your response and sorry for the late reply,

 

It works but I haven't mentioned an important part of the problem. There are 4 times a day when people record attendance:

 

1. When they get in.

2. When they go to lunch

3. When they come back from lunch

4. When they leave for the day.

 

People should get in before 8:30, should go to lunch at 1, should get back from lunch at 2 and leave for the day at 18:00. 

 

I'm using your method but I only see 1 dot per person, when there should be 4 per person (sometimes they don't mark the time, so there should be less dots for that person).

 

This is my data table

 

pregunta6.PNG

 

This is how it looks using your method:

 

pregunta7.PNG

 

As you can see, there's only one dot per person.

 

Thans again!

HI, @carlosflores

     For the values on the Y-axis have to be aggregated, you need to add a "type" for your basic data to classify these Time.

for example:

27.PNG

assume that:

A representative When they get in.

B representative When they go to lunch

C representative When they come back from lunch

D representative When they leave for the day.

 

then drag the field type into Legend values

Result:

28.PNG

here is pbix, please try it.

https://www.dropbox.com/s/9rm7g2gpsivty6p/Scatter%20chart%20with%20hours%20as%20Y%20axis02.pbix?dl=0

 

Best Regards,

Lin

 

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

@v-lili6-msft YES! thank you, it works :') 

v-lili6-msft
Community Support
Community Support

hi, @carlosflores

     Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lili6-msft
Community Support
Community Support

hi,@carlosflores

     After my research, field which is not number couldn't be drag into Y axis in the scatter chart.

But you can achieve the requirement by this way:

Step1:

select time column and then click Add column->From date&time->Time->Hour->Hour in Query Edit

3.PNG

you can also do it by dax

 

Column = HOUR(Table1[Time])

4.PNG

 

also

5.PNG

then create the relationship by hour

 

6.PNG

then drag hour into Y aix and set the aggregate type is Average

9.PNG

 

Result:

8.PNG

 

 

Best Regards,

Lin

 

 

 

 

 

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

Hello @v-lili6-msft, I did it exactly like you did and it won't work. Here's how it looks:

 

pregunta4.PNG

 

I can't add the field with the values of the data source

 

pregunta5.PNG

 

What I'm trying to do with this report is to show who is getting in late, the hour of entrance is 08:30 and we leave at 18:30. This is being done manually and it takes a lot of time. We'd like to automatize this procedure. Please help!

 

Thanks in advance

HI, @carlosflores

     For your requirement, you can just do like these as below:

Step 1:

use this formula to add a column

attend time = HOUR(Table1[Time])*100+MINUTE(Table1[Time])

Step 2:

Do not create any relationship with time fact table, drag this field into Y-axis and set the aggregate type is Average.

15.PNG

Step 3:

set the format of Y-axis start at 600 and end at 2000

16.PNG

Step4:

you can also add two Y-Axis Constant line as the hour of entrance is 08:30 and we leave at 18:30.

17.PNG

Result:

18.PNG

 

here is pbix, please try it.

https://www.dropbox.com/s/n3cj47ymirmju55/Scatter%20chart%20with%20hours%20as%20Y%20axis.pbix?dl=0

 

Best Regards,

Lin

 

 

 

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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