Dynamically change axes of a chart in power by using a slicer? - powerbi-desktop

I have a dataset in power bi in which I have two variables: time of entry and time of exit. The columns have a structure like this:
Time of entry Time of exit
09:00 18:03
09:00 18:00
09:00 18:00
09:02 15:00
09:05 15.02
The case is that I want to make a graph that shows me on the x-axis the hours of departure and on the y-axis the count that has had this particular hour. And the same with the entry time. Although it is possible to use two graphs (one with each subject) I would like the graph to change the axes dynamically using a slicer.
I have consulted some pages on youtube, and I am looking for the simplest possible way to do it, but I can't get it to work. I have tried configuring a parameter and DAX code.

You can achieve your goal by using field parameters:
How to activate it:
Go to Modeling Tab --> New Parameter --> Fields
Then
Create a simple measure:
HourCount =
COUNT(Timescale[Time of entry])
Then Create a line chart, put the created field parameter on the x_axis:
Resulting Screenshot:

Related

How to have 2 headers (row & column)

I want to create a table where there are 2 axis. It seems I can only create a table where the first row is a header/axis.
My table looks something like this:
1/1/21
2/1/21
3/1/21
10:00:00 AM
Work
Work
Work
11:00:00 AM
Relaxing
Work
Watching TV
12:00:00 AM
Work
Relaxing
Watching TV
13:00:00 AM
Lunch
Lunch
Work
As you can see the time and the date are axis. This way I can create a column graph and see how many hours I spent doing one thing each day. And I can also create another chart and see what thing I do the most during each hour. How am I able to do this?
Records have one "axis" only: Fields.
So, combine date and time into one field, have another field for work type, and then use a crosstab query filtering on a period of dates and grouping on time of the date/time values.

Advance Excel chart, scatter chart with multiple axis value with time lapse

I have 7 different measurement points on which is temperature measured for every hour (timestamp). Like these pic down.
I want graph similar like these.
Data table:
timestamp m1_temp m1_dist m2_dist m2_temp
Mar 9, 2017 12:00:00 AM 51.72 20.00 10.00 41.72
Mar 9, 2017 1:00:00 AM 48.73 20.00 10.00 38.73
Mar 9, 2017 2:00:00 AM 43.51 20.00 10.00 33.51
I get:
So problem is now:
I need to pick timestamp range (button or just calendar with time) and see animation (not real animation, it would look like that because data ranges would change for example every 2 seconds) on chart trough that time. It would be great to see chart title as timestamp.
Maybe connect points with line, it would be more visible to the viewer.
Thanks in advance
Currently, I don't think it's possible to have timelapse animation in Power BI visuals.
There is an idea related to this that you can vote on though:
Animation for ALL!
Without animation, there are a couple possible ways to attempt a similar thing. Either use a slicer for time or else show all times at once.
To do this, your data will need to be formatted a bit differently like this:

Need to group Time Slots in Excel

I am working on logistics data. I have booking being made throughout the day at regular intervals from start to the end of the day.
Now these booking are consistent and I have time from like
04:45
21:10
21:10
06:07
05:44
05:45
05:45
05:45
etc.
Now as there are multiple bookings I need to group them such as
04:00- 05:00 (1 hours)- this should capture all booking made during this period.
Similar for other hours during the day.
By doing this I will be able to group individual values into specific group. Can you please advice how to achieve the same in excel.
If the values are stored as dates in Excel, the Pivot Table has this functionality built in already with the "Group Field" option. You can group by Hours which is probably what you want. Note that you can select multiple items to get a hierarchy of groups as shown below. This will break if the underlying data is not formatted as a Date so watch out for that.
If you do not have true dates and just have times, you can format as a Time in Excel and it will work. Just don't show the days/date because it will be gibberish.
add a column truncating the time to hours
along the lines of =time(hour(z),0,0)
then create a pivot table using the hour column

Create a Gantt (Stacked Bar Chart) in excel with time breaks

I have been struggling with creating an more advanced Gantt chart with Excel than the simple Stacked Bar Chart that is typically used in the examples I have seen in the web. For my example I would like to group multiple rows for the and entity on one row of the final Gantt. See the example data below:
Employee Start End
EMPL1 2:00 4:00
EMPL1 6:00 8:00
EMPL2 1:00 5:00
EMPL3 3:00 4:00
EMPL3 7:00 8:00
With the data above I would like the Gantt chart to group items for a single employee into a specific row as shown below. So for example, Employees 1 & 3 have two separate times, but their data is displayed on a single row in the Gantt.
TIME 1 2 3 4 5 6 7 8 9
Empl1 XXXXXXXXXXX XXXXXXXXXX
Empl2 XXXXXXXXXXXXXXXXXXXXX
Empl3 XXXXXX XXXXX
Can excel generate a report like the one below? I have done simple Gantts using a start date and a duration to create a Stacked Bar Chart and that works fine, but I haven't been able to find a way to group multiple rows of data together for a single line on a chart.
Yes, but probably easiest with a different data layout and in the example below using Insert Stacked Bar, Switch Row/Column, Y-axis categories in reverse order and X-axis range set to 1-9:

frequency distrbution based on 24 hours

I have a power pivot table with a date time entry (which can be changed to any-type of output with a case statement) Format (2012-01-01 00:00:30.000) Which I need to figure out how many of these entry's for any day arrived from 1:00 Am to 1:59 A, and 2:00 am to 2:59 am etc?
How do I format the Bin frequency in excel so I build the hour buckets?
I do want to graph more than one day but that could be done on the SQL side.
You might need to make a new table to chart the frequency distributions. Here's an example.
The formula
=COUNTIFS(A$2:A$17,"<"&F6,A2:A17,">="&E6)
will provide what you want. You can adjust the limits for min/max with the chart shown. Sorry, I couldn't figure out how to easily share the excel file.
As an alternative to the other answer which is valid, you can create a pivot table based off of your data and then group it by right-clicking anywhere in the pivot table, selecting "Group..." and telling it how you want to group the data. You can group by Months, Days, Hours, Minutes, etc...

Resources