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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
H_s
Regular 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
v-nuoc-msft
Community Support
Community Support

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
Regular Visitor

@v-nuoc-msft thanks!! it's working....thank u so much.

View solution in original post

2 REPLIES 2
H_s
Regular Visitor

@v-nuoc-msft thanks!! it's working....thank u so much.

v-nuoc-msft
Community Support
Community Support

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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