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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
c_hudson
New Member

merge query with multiple conditions

I've been beating my head against the wall all day on this, hoping someone can assist.  I have a list of Projects, each with a variable amount of Activities, and a yes/no value if the Activity is completed.  I want to consolidate the list into a single row for each Project and return a 'yes' value if all the Activities are completed, or a 'no' value if not all of the Activities are completed.  So something like this

 

pic.jpg

 

My dataset has aound 300 projects, 18,000 activities, and is growing.  Thanks!

1 ACCEPTED SOLUTION
SivaMani
Resident Rockstar
Resident Rockstar

@c_hudson,

I have an idea. Please check will it work or no

  • Create a derived column from Activity Completed.
    • Derived Activity Completed = IF('Table'[Completed?] = "Yes",1,-1) 
  • Create a measure
    • Project Completed = IF(MIN('Table'[Derived Activity Completed]) = 1,"Yes","No")
  • Use the measure whereever you need project status
ProjectActivity Name Activity Completed?Derived Activity Completed
Project 1AYes1
Project 1BYes1
Project 1CYes1
Project 2DYes1
Project 2ANo-1
Project 2BNo-1
Project 2CYes1

 

Hope this will resolve your problem!

 

Appreciate your kudos!

 

Regards,

Siva Mani

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

Try.

If will work for view by project. But for GT , you might have to use summarize

 

if((
count(project[Activity Name])-
countx(filter(project,project[Activity completed]="Y"),project[Activity Name]))>0,"No","Yes")

calculate(Countx(filter(summarize(project,project[project ID],"_tot",count(project[Activity Name]),
"_ctot",countx(filter(project,project[Activity completed]="Y"),project[Activity Name])),([_tot]-[_Ctot])>0),[_ctot]))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
SivaMani
Resident Rockstar
Resident Rockstar

@c_hudson,

I have an idea. Please check will it work or no

  • Create a derived column from Activity Completed.
    • Derived Activity Completed = IF('Table'[Completed?] = "Yes",1,-1) 
  • Create a measure
    • Project Completed = IF(MIN('Table'[Derived Activity Completed]) = 1,"Yes","No")
  • Use the measure whereever you need project status
ProjectActivity Name Activity Completed?Derived Activity Completed
Project 1AYes1
Project 1BYes1
Project 1CYes1
Project 2DYes1
Project 2ANo-1
Project 2BNo-1
Project 2CYes1

 

Hope this will resolve your problem!

 

Appreciate your kudos!

 

Regards,

Siva Mani

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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