Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi
Can someone help me build a bar graph that has a period (start and end) with a value
the idea is to create something like this:
table sample:
rate - bar size (Y axis)
reason - color
Time range - start and end of bar
rate | TIME RANGE | reason |
23 | 12:00 - 14:00 | G |
16 | 05:10 - 05:30 | W |
12 | 05:00 - 05: 10 | W |
20 | 05:30 - 08:40 | W |
23 | 08:40 - 11:00 | G |
Hi, @gantunes
ou need to split the TIME RANGE column into separate Start Time and End Time columns:
Go to Transform Data to open Power Query Editor.
Select the TIME RANGE column.
Use the Split Column feature to split by delimiter (-).
Rename the new columns to Start Time and End Time
Change the data type of the Start Time and End Time columns to DateTime. Adjust the times by adding a date if needed (e.g., the same date for all entries).
Go back to the main Power BI report view:
Select a Stacked Bar Chart or Clustered Bar Chart.
Drag the rate column to the Values field.
Drag the Start Time column to the Start field or to the Axis field.
Drag the End Time column to the End field
Drag the reason column to the Legend field to color code by reason.
Click on the X-Axis in the visual. Format the X-Axis to display time.
If you want more control or a visual specifically designed for Gantt charts:
Go to the AppSource marketplace within Power BI. Search for Gantt Chart visuals and add one to your Power BI report. Use the custom Gantt chart visual to map rate, Start Time, End Time, and reason.
If you need to calculate durations or other metrics, you might use DAX measures like this:
Duration = DATEDIFF('YourTable'[Start Time], 'YourTable'[End Time], MINUTE)
Ensure rate is on the Y-Axis. Ensure Start Time and End Time are correctly configured. Use reason to color the bars.
hackcrr
If this post helps, then please consider Accept it as the solution and kudos to this post to help the other members find it more quickly
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
109 | |
99 | |
95 | |
38 | |
37 |
User | Count |
---|---|
151 | |
125 | |
75 | |
74 | |
53 |