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
aflintdepm
Helper III
Helper III

DAX Formula to "Collect" multiple Rows

I'm trying to collect or summarize the status of tasks based on a person, but each task is a separate row.

 

Here is an example of data:

NameTask NameStatus
Bob SmithTask 1Completed
Bob SmithTask 2Pending
Jane DoeTask 1Pending
John JonesTask 1Completed
John JonesTask 2Completed

 

What I would like is a formula that says - For [Name], if any Task is Pending, then "Task Name", otherwise "Complete"

 

So, my desired results would look like this:

 

Bob Smith | "Task 2"

Jane Doe | "Task 1"

John Jones | "Complete"

 

Any examples or tutorial references would be appreciated.

2 REPLIES 2
Ahmedx
Super User
Super User

pls try this


Screen Capture #1192.png

 

Measure 1 =
COALESCE(
CALCULATE(MAX('Table'[Task Name]), 
CONTAINSSTRING("Pending",'Table'[Status])),"Completed")

------- or-----------
Measure 2 = 
CALCULATE(SELECTEDVALUE('Table'[TaskName],"Completed"),
             CONTAINSSTRING("Pending",'Table'[Status]))

 

 

Ashish_Mathur
Super User
Super User

Hi,

This measure works

Measure = COALESCE(minx(FILTER(SUMMARIZE(VALUES(Data[Task Name]),Data[Task Name],"ABCD",MAX(Data[Status])),[ABCD]="Pending"),Data[Task Name]),"Complete")

Untitled.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.