this is what i have done in the past
CALCULATE ( SUM ( Methods[F_Not_Covered_Lines] ), DISTINCT ( SUMMARIZE ( Methods, Methods[ModuleName], Methods[NamespaceName], Methods[ClassName] ) )
So use summarize to summarize the data to the level you want above the grain-> wrap it in a distinct -> pass it as a filter to a calculate function and do your aggregation
Engage and empower students with Power BI!
Continue your learning in our online communities.
Travel to Melbourne and network with thousands of peers!
Check out what's new in the Power BI Community!