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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
kamini
Helper III
Helper III

Cluster Bar Chart Showing Years Based on Start and End Date of Activities

Hi folks,

I'm trying to create a Cluster Bar Chart that shows years (only) at the X-Axis but the Bars will show the information based on different activities Start and End Date. Below is an example of what I need to establish.,

kamini_1-1725910314142.png

So, as above shows, I'm trying to have the Bar Chart and the left activities information in the same visual. 

I greatly appreciate your time.

Thank you,

 

2 ACCEPTED SOLUTIONS

lbendlin_0-1725982239648.png

you can play with the settings yourself.

Column = 
var mind = minx(all(Projects[Start Date]),[Start Date])
var maxd = maxx(all(Projects[Finish Date]),COALESCE([Finish Date],TODAY()))
var svg = 
"data&colon;image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 " & format(maxd-mind,"#") & " 65'>
<rect fill='#3d5599' x='" & format([Start Date]-mind,"#") &  "' width='" & format(COALESCE([Finish Date],TODAY())-[Start Date],"#") &  "' height='100%'></rect>
<rect fill='#001f3f' x='" & format(dt"2023-01-01"-mind,"#") &  "' y='0' width='2' height='35'></rect>
<rect fill='#001f3f' x='" & format(dt"2024-01-01"-mind,"#") &  "' y='0' width='2' height='35'></rect>
<rect fill='#001f3f' x='" & format(dt"2025-01-01"-mind,"#") &  "' y='0' width='2' height='35'></rect>
<text font-size='x-large' fill='#0074d9' x='" & format(dt"2023-01-01"-mind,"#") &  "' y='60'>FY23</text>
<text font-size='x-large' fill='#0074d9' x='" & format(dt"2024-01-01"-mind,"#") &  "' y='60'>FY24</text>
<text font-size='x-large' fill='#0074d9' x='" & format(dt"2025-01-01"-mind,"#") &  "' y='60'>FY25</text>
</svg>"
return svg

View solution in original post

16 REPLIES 16
lbendlin
Super User
Super User

I'm trying to have the Bar Chart and the left activities information in the same visual. 

That's a bold goal. Is it truly necessary?  If yes, you will have to use SVG images inside the table column.

Unfortunately, it is necessary demanded by the client. 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

NameStart DateFinish DateStatus 
Assist Payment Processing Deleting Old IBML Batch Images3/1/20233/31/2023Completed 
Build FFX 5.0 Machine for UCP10/24/202311/24/2023Not Started 
Create Reports forLegacy Scanning3/1/2023 Completed 
Decommission OLD Environment10/4/202311/16/2023In Progress 
Enable Encryption for Databases3/6/2023 Completed 
Fix Form Issue3/1/20234/28/2023Completed 
Group Policy Cleanup2/24/20231/19/2024In Progress 
IBML Application Upgrade3/1/202312/22/2023On Hold 
Migrate Users From WebEx to MS Teams7/12/20231/19/2024Not Started 
Resolve Check Identification Issue3/6/20234/14/2023Completed 
Perform system A Upgrade9/12/202210/13/2022In Progress 
Perform system B Upgrade10/13/202211/13/2022In Progress 
Perform system C Upgrade11/14/202212/13/2022In Progress 
Perform system D Upgrade12/15/20221/13/2023In Progress 
Maintain Annapolis 9/5/202312/14/2023In Progress 
Maintain Baltimore10/5/202412/11/2024Not Started 
Clear ATCC from Gov Delivery8/10/20238/16/2023Completed 
Perform Audit Findings and Remediations8/14/20238/28/2023Completed 
Apply IBML SCS  Legacy DBs3/1/2023 Completed 

So, basically, I'm trying to show the list of activities (Name in sample data) their Start Date and Finish Date, but very importantly, show the right hand Bar Chart showing per year the Duration of activities (Bars). 

Thank you for your time.

Your original picture has fiscal years and colors?

The colors per year would be helpful (+Legend) but most importantly, the Bars of the Chart (basd on Duration) and the X-AXIS showing the years is the most important part of this product. Thank you!

Here's a basic idea of how this would look like

 

lbendlin_0-1725979523673.png

 

That is great and pretty much what I was asking. If you have any recommendations for adding the FY22 FY23 on the bottom or top of the Bar chart based on the Durations, please let me know.🤔 Thank you,

what are the start dates for these?

 

The Start Date is the same as each Task's Start Date shown as a part of the Sample Data. Thank you!

I need to know when FY22 and FY23 begin.

Ah, Ok, 

All years starts in January 1, 2022 and ends Dec 31, 2022. The New Year will be Jan 1. 2023. It is based on the US calendar year. 

Thank you

lbendlin_0-1725982239648.png

you can play with the settings yourself.

Column = 
var mind = minx(all(Projects[Start Date]),[Start Date])
var maxd = maxx(all(Projects[Finish Date]),COALESCE([Finish Date],TODAY()))
var svg = 
"data&colon;image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 " & format(maxd-mind,"#") & " 65'>
<rect fill='#3d5599' x='" & format([Start Date]-mind,"#") &  "' width='" & format(COALESCE([Finish Date],TODAY())-[Start Date],"#") &  "' height='100%'></rect>
<rect fill='#001f3f' x='" & format(dt"2023-01-01"-mind,"#") &  "' y='0' width='2' height='35'></rect>
<rect fill='#001f3f' x='" & format(dt"2024-01-01"-mind,"#") &  "' y='0' width='2' height='35'></rect>
<rect fill='#001f3f' x='" & format(dt"2025-01-01"-mind,"#") &  "' y='0' width='2' height='35'></rect>
<text font-size='x-large' fill='#0074d9' x='" & format(dt"2023-01-01"-mind,"#") &  "' y='60'>FY23</text>
<text font-size='x-large' fill='#0074d9' x='" & format(dt"2024-01-01"-mind,"#") &  "' y='60'>FY24</text>
<text font-size='x-large' fill='#0074d9' x='" & format(dt"2025-01-01"-mind,"#") &  "' y='60'>FY25</text>
</svg>"
return svg

Would you mind sending me the pbix file so I can continue the customization from there. Thanks so much!

 

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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