Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
how to implement this query in power bi
select epu.[Project Status] INTO #temp from pjrep.MSP_EpmProject_UserView epu (nolock) where
([Project Departments] = @ProjectDepartmentName or @ProjectDepartmentName = '-1') and
([Concept Type] = @ConceptType or @ConceptType = '-1') and
([Primary Technology Department] = @PrimaryTechnologyDepartment or @PrimaryTechnologyDepartment = '-1') and
([Business Sponsor] like '%' + @CommercialProductOwner + '%' or @CommercialProductOwner = '-1')
select
(select count(*) from #temp where [Project Status] = 'On Schedule' ) as Green,
(select count(*) from #temp where [Project Status] = 'Not Started' or [Project Status] = 'Possible Delayed' ) as Yellow,
(select count(*) from #temp where [Project Status] = 'Delayed' or [Project Status] = 'Suspended' ) as Red
Solved! Go to Solution.
The proper answer is below :
Use CALCULATE function and get (Project Status) data in PIE chart.
Get all parameters into three drop downlists.
then drag and drop Project Status on PIE Chart.
Hi @basim,
Could you please mark the proper answers as solutions?
Best Regards,
Dale
The proper answer is below :
Use CALCULATE function and get (Project Status) data in PIE chart.
Get all parameters into three drop downlists.
then drag and drop Project Status on PIE Chart.
Thank you so much for sharing with us. @basim,
Best Regards,
Dale
Hi @basim,
Seems you want a DAX formula. It could be like below. But the details are based on your data. If you need it, please provide a sample data.
#temp = filter( selectcolumns(msp_epmproject_userview, "Project Status", [project status]), ([project departments] = @ProjectDepartmentName OR @ProjectDepartmentName = '-1' ) && ( [concept type] = @ConceptType OR @ConceptType = '-1' ) && ( [primary technology department] = @PrimaryTechnologyDepartment OR @PrimaryTechnologyDepartment = '-1' ) && ( [business sponsor] LIKE '%' + @CommercialProductOwner + '%' OR @CommercialProductOwner = '-1' )
Best Regards,
Dale
Hi @basim,
You can use this SQL query directly in Power BI.
Go To >
Get Data > Sql Server > Advance options > Put your Sql Query.
Make sure you have last statement as select * from #temp , so that you query should return something.
Thanks,
Jayant
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
79 | |
60 | |
36 | |
33 |
User | Count |
---|---|
91 | |
60 | |
59 | |
49 | |
45 |