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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
H_s
Frequent Visitor

Measure that count the Project on the based of Status Field

Hi,

I want to create a measure to calculate the count of the project on the based of Status field. The status field have three status value as "Yet to Start", "In progress" and "Closed".
The condition is: 
Let assume that  there are 3 projects A,B and C and these are in there audit stage and these can have one aur multiple defect with unique defect Id. So if the value of Status field for any project is "Yet to start" then this project should count in Yet to start stage and if the value of Status field for any project is "In Progress" then this project should count in In Progress and same if the value of Status field for any project is "Closed" then this project should count in Closed stage.

And if the value of Status field for any project is "Yet to start" and  "In Progress" as well then this project should count in Yet to start stage. 

And if the value of Status field for any project is "Yet to start" , "In Progress"  and "Closed "as well then this project should also count in Yet to start stage. 

And if the value of Status field for any project is  "In Progress"  and "Closed "as well then this project should  count in In progress stage.

Mean if for any project the value of status field is more than 2 or more than 2 then it should be count in its initial stage among the status value.

Please share your suggestion and guide me.
thanks.

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @H_s 

 

For your question, here is the method I provided:

 

Here's some dummy data

 

"Table"

vnuocmsft_0-1710310282825.png

 

Create measures.

 

First, mark each of the three status you mentioned with numbers.

 

Mark_NUM = 
    SWITCH(
        TRUE(),
        SELECTEDVALUE('Table'[Status]) = "Yet to Start", 1,
        SELECTEDVALUE('Table'[Status]) = "In progress", 2,
        SELECTEDVALUE('Table'[Status]) = "Closed", 3
    )

 

vnuocmsft_5-1710311083456.png

 

Query the minimum mark_num under each project.

 

Min_Mark_NUM = 
    MINX(
        FILTER(
            ALL('Table'), 
            'Table'[Project] = MAX('Table'[Project])
        ), 
        'Table'[Mark_NUM]
    )

 

vnuocmsft_2-1710310889283.png

 

Query initial status.

 

Initial Status = 
    IF(
        [Mark_NUM] = [Min_Mark_NUM], 
        VALUES('Table'[Status]), 
        BLANK()
    )

 

Here is the result.

 

vnuocmsft_3-1710311015048.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

H_s
Frequent Visitor

@Anonymous thanks!! it's working....thank u so much.

View solution in original post

2 REPLIES 2
H_s
Frequent Visitor

@Anonymous thanks!! it's working....thank u so much.

Anonymous
Not applicable

Hi @H_s 

 

For your question, here is the method I provided:

 

Here's some dummy data

 

"Table"

vnuocmsft_0-1710310282825.png

 

Create measures.

 

First, mark each of the three status you mentioned with numbers.

 

Mark_NUM = 
    SWITCH(
        TRUE(),
        SELECTEDVALUE('Table'[Status]) = "Yet to Start", 1,
        SELECTEDVALUE('Table'[Status]) = "In progress", 2,
        SELECTEDVALUE('Table'[Status]) = "Closed", 3
    )

 

vnuocmsft_5-1710311083456.png

 

Query the minimum mark_num under each project.

 

Min_Mark_NUM = 
    MINX(
        FILTER(
            ALL('Table'), 
            'Table'[Project] = MAX('Table'[Project])
        ), 
        'Table'[Mark_NUM]
    )

 

vnuocmsft_2-1710310889283.png

 

Query initial status.

 

Initial Status = 
    IF(
        [Mark_NUM] = [Min_Mark_NUM], 
        VALUES('Table'[Status]), 
        BLANK()
    )

 

Here is the result.

 

vnuocmsft_3-1710311015048.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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