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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
YoutheshSagar
New Member

Need help on creating measure

Hi,

 

I have data as shown below.

YoutheshSagar_0-1677750013726.png

I Have a Plan table as shown below.

YoutheshSagar_1-1677750066298.png

 

My requirement is to create % completion measure based on the below logic ],

Note - Current Phase should use Status=completed only

 

% Completion 
PHASE 
Gap AnalysisGap Analysis (Status=completed) + design + build + QA + UAT + Deployment/total projects
DesignDesign (Status=completed) + build + QA + UAT + Deployment/total projects
BuildBuild (Status=completed) + QA + UAT + Deployment/total projects
QAQA (Status=completed) +  UAT + Deployment/total projects
UATUAT (Status=completed) + Deployment/total projects
DeploymentDeployment (Status=completed)/total projects
1 REPLY 1
SamInogic
Super User
Super User

Hi @YoutheshSagar ,

As per your requirement, we have created a sample Power BI report with two tables Phases Table, Plan Table. Please refer to the below screenshot.

SamInogic_3-1677760221651.png

Now you want the % completion column according to formulae you provided so you can follow below steps for the same.

Create a column in Plan Table with below DAX expression which will calculate the count of projects in current Phases table:

CurrentPhaseProjects = CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Plan Table'[Phase] = 'Phases Table'[Phase]), 'Phases Table'[Status]="Completed")

Please refer to the below screenshot for the same.

 

SamInogic_4-1677760245527.png

 

Create another column in Plan Table with below DAX expression which will calculate the % Completion based on current Phase in Plan Table:

 

% Completion =

SWITCH('Plan Table'[Phase],

"GAP Analysis", DIVIDE('Plan Table'[CurrentPhaseProjects] + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "Design")) + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "Build")) + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "QA")) + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "UAT")) + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "Deployment")),COUNTROWS('Phases Table')),

 

"Design",DIVIDE('Plan Table'[CurrentPhaseProjects] + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "Build")) + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "QA")) + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "UAT")) + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "Deployment")),COUNTROWS('Phases Table')),

 

"Build",DIVIDE('Plan Table'[CurrentPhaseProjects] + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "QA")) + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "UAT")) + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "Deployment")),COUNTROWS('Phases Table')),

 

"QA",DIVIDE('Plan Table'[CurrentPhaseProjects] + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "UAT")) + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "Deployment")),COUNTROWS('Phases Table')),

 

"UAT",DIVIDE('Plan Table'[CurrentPhaseProjects] + CALCULATE(COUNTROWS('Phases Table'), FILTER('Phases Table', 'Phases Table'[Phase]= "Deployment")),COUNTROWS('Phases Table')),

 

"Deployment", DIVIDE('Plan Table'[CurrentPhaseProjects],COUNTROWS('Phases Table'))

)

This will result in Completion % for each phase in Plan Table as shown in the below screenshot,

SamInogic_5-1677760295405.png


If this answer helps, please mark it as Accepted Solution so it would help others to find the solution.


Thanks!

Inogic Professional Service Division

An expert technical extension for your techno-functional business needs

Power Platform/Dynamics 365 CRM

Drop an email at crm@inogic.com

Service:  http://www.inogic.com/services/ 

Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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