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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
festazen
Microsoft Employee
Microsoft Employee

Help with calculating the # of records in one table based on criteria from a second table

Not sure how to describe what I'm looking to do so I'll show you examples of the tables I have and the output I'm trying to achieve.

 

I have tow tables (Opportunities and Milestones) that are connected by the OpportunityID Column.

 

The  Opportunities table records each have a unique ID (OpportunityID)

festazen_0-1709093703288.png

 

The Milestones table represents child records of the Opportunities table.

  • Each Opportunities record has one or more Milestones records.
  • Each Milestones record can only be associated with a single Opportunities record.
  • Each Milestones record has a Workload values associated with it.

festazen_1-1709093727847.png

 

Desired Output

I would like to be able to display # of Opportunties records based on the # of unique Workloads per Opportunities record. Like this:

festazen_2-1709094143706.png

 

I believe I need to add a new column (Unique Workloads pe Opportunity) but can't figure out the proper syntax.

 

Any help would be appreciated.

1 REPLY 1
VillyMBI
Resolver I
Resolver I

HI @festazen ,

 

Try adding new DAX measure in the table.
like

Opp per Workload =
VAR _Worload = SELECTEDVALUE(Milestone[Workload])
RETURN CALCULATE( DISTINCTCOUNT([OpportunityID]), FILTER(Milestone, [Workload] = _Worload))

I hope this will help you.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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