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
Anonymous
Not applicable

Need DAX quey for User completed all Trainings and if any of the user not completed show as in progr

Rocky_123_1-1658921206320.png

In above table I need dax query for Training requirement(TR), if all users completed TR then TR status should be Completed. If any of the user is IN Progress or Not completed then status should be In Progress. similarly is all are Not started it should be Not started. This is like and operation 

Rocky_123_2-1658921500160.png

Can some one help on this ASAP

1 ACCEPTED SOLUTION

Hi @Anonymous 
Here is the updated solution 

2.png1.png

TR Status = 
VAR NormalValue = SELECTEDVALUE ( Tasks[Satus] )
VAR AllStatus = CALCULATETABLE ( VALUES ( Tasks[Satus] ), ALLEXCEPT ( Tasks, Tasks[Trainee] ) )
VAR Completed = FILTER ( AllStatus, Tasks[Satus] = "Completed" )
VAR NotStarted = FILTER ( AllStatus, Tasks[Satus] = "Not Started" )
RETURN
    SWITCH ( 
        TRUE ( ),
        COUNTROWS ( AllStatus ) = COUNTROWS ( Completed ), "Completed",
        COUNTROWS ( AllStatus ) = COUNTROWS ( NotStarted ), "Not Started",
        "In Progress"
    )

View solution in original post

8 REPLIES 8
tamerj1
Super User
Super User

Hi @Anonymous 
Here is a sample file with the solution https://we.tl/t-RWLCO2vdgj

1.png 

TR Status = 
VAR NormalValue = SELECTEDVALUE ( Tasks[Satus] )
VAR AllStatus = VALUES ( Tasks[Satus] )
VAR Completed = FILTER ( AllStatus, Tasks[Satus] = "Completed" )
VAR NotStarted = FILTER ( AllStatus, Tasks[Satus] = "Not Started" )
RETURN
    SWITCH ( 
        TRUE ( ),
        ISINSCOPE ( Tasks[Task] ), NormalValue,
        COUNTROWS ( AllStatus ) = COUNTROWS ( Completed ), "Completed",
        COUNTROWS ( AllStatus ) = COUNTROWS ( NotStarted ), "Not Started",
        "In Progress"
    )
Anonymous
Not applicable

Thanks for the query.. Almost worked. But for all completed also it is showing IN Progress.

Rocky_123_0-1658936683927.png

 

Hi @Anonymous 
Here is the updated solution 

2.png1.png

TR Status = 
VAR NormalValue = SELECTEDVALUE ( Tasks[Satus] )
VAR AllStatus = CALCULATETABLE ( VALUES ( Tasks[Satus] ), ALLEXCEPT ( Tasks, Tasks[Trainee] ) )
VAR Completed = FILTER ( AllStatus, Tasks[Satus] = "Completed" )
VAR NotStarted = FILTER ( AllStatus, Tasks[Satus] = "Not Started" )
RETURN
    SWITCH ( 
        TRUE ( ),
        COUNTROWS ( AllStatus ) = COUNTROWS ( Completed ), "Completed",
        COUNTROWS ( AllStatus ) = COUNTROWS ( NotStarted ), "Not Started",
        "In Progress"
    )
Anonymous
Not applicable

Thanks a lot. This query worked. U r the master.

SpartaBI
Community Champion
Community Champion

@Anonymous you need a DAX query / DAX calculated column / DAX measure to plot it eventually in a visual? 3 different things 🙂
Also, can you please provide a sample data to work on (not a screenshot)

Anonymous
Not applicable

I Need DAX Column and I don't have access to send data. Only I can send screenshots

@Anonymous 

 

Result_CC = 
SWITCH(
	TRUE(),
	'Table'[Task1] = "Not Started" && 'Table'[Task2] = "Not Started" && 'Table'[Task3] = "Not Started", "Not Started",
	'Table'[Task1] = "Completed" && 'Table'[Task2] = "Completed" && 'Table'[Task3] = "Completed", "Completed",
	"In Progress"
	)

 


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

Anonymous
Not applicable

Thanks for the reply. I need query based on user and status.

Like in a Training 1 if all the users completed then in should be completed. Plz try on this

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.

Top Solution Authors