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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Filtering

I want to filter the job numbers based on the the type of attachment uploaded in the project attachment table (subject= A or subject= B). The users upload attachments with quotes, invoices, etc and title the subject type "A", but then upload an empty attachment with the subject as type "B". I need to be able look at all attachments for that one job number and if it has an attachment with the B subject then call it a type B job. I'm not sure if thats possible with the way data is read in Power BI, but if anyone has suggestions I would appreciate it. Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Check this formula.

flag = if(CONTAINSSTRING(ProjectAttachment[Subject],"T&M"),"Y","N")

Column = MAXX(filter(ProjectAttachment,ProjectAttachment[ProjectID]=EARLIER(ProjectAttachment[ProjectID])),[flag])

vjaywmsft_0-1651658754373.png

 

Best Regards,

Jay

View solution in original post

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

Please provide sample data or a non-confidential PBIX file, and a depiction of what you are trying to achieve. Thanks!





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

Sorry heres a visual of what I'm working with

Project Table:

ProjectID    Jobnumber
10001
10012
10023

 

ProjectAttachment Table:

ProjectAttachmentID   ProjectID  Subject Vendor Cost  Contractor Cost  Estimated Hrs   
2000011000"Customer Quote"1001002
2000031001"Customer Quote"50050010
2000041001"Customer T&M"000
2000051002"Customer T&M"10101

So in this example ProjectID 1001 has both a Quote and T&M attachment uploaded, but it is still considered a T&M project

I'm hoping to have a True/False column on whether its a "T&M" project like so:

ProjectAttachment Table:

ProjectID  Jobnumber  Is T&M 
10001N
10012Y
10023Y
Anonymous
Not applicable

Hi @Anonymous ,

 

Check this formula.

flag = if(CONTAINSSTRING(ProjectAttachment[Subject],"T&M"),"Y","N")

Column = MAXX(filter(ProjectAttachment,ProjectAttachment[ProjectID]=EARLIER(ProjectAttachment[ProjectID])),[flag])

vjaywmsft_0-1651658754373.png

 

Best Regards,

Jay

Anonymous
Not applicable

In the column formula, it wouldn't let me put "Earlier= projectattachment[projectID]" so I replaced it with "Earlier= Project[ProjectID]" and it worked, thanks for the help! 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.