Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 51 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 64 | |
| 39 | |
| 33 | |
| 23 |