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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anjali66
New Member

Creating a Pie chart and bar graph by passing a query to Captiva desktop

Hi All,

I am very new to power BI. I have the follwoing data in my table

StartDate     endDate         FirtsName LastName      Section          ProjectName TotalHours
12-06-2018    12-19-2018       M1          ML1         Developer       Project1      14
11-22-2018    12-5-2018          M2          ML2         QA            QAProject     20
12-06-2018    12-19-2018        M1          ML1        Developer       Project3      10

I want to show a bar chart and pie chart in my power bi desktop that shows the hours spend by each developer on each project. Also, is it possible for the user to filter the chart based on startDate, endDate and/or project Name

I am connectimng to the sql server and passing the below query to power BI desktop to get the above data:

 

select pp.StartDate, pp.EndDate
,rs.FirstName, rs.LastName, rs.Section
,pd.Name
,tsd.Hours1+ tsd.Hours2 + tsd.Hours3 + tsd.Hours4 + tsd.Hours5 + tsd.Hours6 + tsd.Hours7 + tsd.Hours8+ tsd.Hours9 + tsd.Hours10 + tsd.Hours11 + tsd.Hours12 + tsd.Hours13 + tsd.Hours14 as TotalHours
from [dbo].[TimeSheet] ts
Inner join [dbo].[TimeSheetHours] tsd on ts.Id= tsd.TimeSheetId
inner join [dbo].[PayPeriod] pp ON ts.PayPeriodId = pp.Id
inner join [dbo].[Resource] rs ON ts.ResourceId = rs.Id
inner join [dbo].[ProjectDetail] pd ON tsd.ProjectId = pd.Id
order by pp.StartDate desc  

any help or any tutorial related to the topic will be highly appreciated.

1 REPLY 1
itsmebvk
Continued Contributor
Continued Contributor

@Anjali66 Please see the attached PBIX.  You modify it according to your requirement.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors