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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
troyhimes
Resolver I
Resolver I

Require correct Parent total using Child if/then measure

 

Parent/Child Table 

 

I've been out-daxed again.  I need a measure that counts the occurrences in a period when a Child field value exceeds a set value and totals those occurrences for the Parent field.  In the example, measures 'COUNT' and 'count2', count occurrences whenever the Child tonnage exceeds 25 tons. 

 

Both measures work as expected on the Child level but neither work as expected when totalling the Child occurrences by Parent.  I understand why each of the measures don't yield the expected result but I can't figure out to get the expected result. 

From the example: Parent = 4, there are 2 occurrences during January where the Child values have exceeded 25 tons so the expected result would be 2.

 

COUNT:=IF(SUM(Table1[TONS])>25,1,BLANK())

count2:=IF(SUM(Table1[TONS])>25,DISTINCTCOUNT(Child]),BLANK())

 

2023-03-09_9-30-59.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@troyhimes , you need to have a new measure based on count 2 and columns in visual

 

Sumx(Summarize(Table, Table[Col1], Table[Col2], Table[Date], "_m", [count2]) , [_m])

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@troyhimes , you need to have a new measure based on count 2 and columns in visual

 

Sumx(Summarize(Table, Table[Col1], Table[Col2], Table[Date], "_m", [count2]) , [_m])

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

Thanks @amitchandak!  I had tried the summarize function but didn't fully understand how to add the values across the summarize table

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.