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! Learn more

Reply
Anonymous
Not applicable

Help with grouped sum

I will appreciate a quick help here 

 

In this table (table A). Confidence score is not summerised.

And no grouping.

 

Link to csv:   https://drive.google.com/file/d/1RWPdBo8_BcGwFILGRUtBe9x9p8XAWgc8/view?usp=sharing

 

Olajumi_0-1629481409655.png

 

I need to create a measure of count of ConsumerIdTaskcodes  (Grouped by ConsumerIdtaskcode) where Confidencescore  (of each group) > 71.   

 

The result desired is  6 - based on summed/aggregated grouping. 

 

Olajumi_1-1629502399486.png

 

But I keep getting 2 (meaning it is checking raw data before aggregation.

 

Please assume you are working with Table A

Her is my measure:

  

*Total ConsumerTask codes grouped GROUP =
CALCULATE(DISTINCTCOUNT(('report ConsumerTaskCodes'[ConsumerIDTaskCode])), FILTER('report ConsumerTaskCodes','report ConsumerTaskCodes'[*Total confidence score Taskcode Temp] > 71))
 
Thank for your help.
 
@sevenhills :  I made the question clearer.
 
2 ACCEPTED SOLUTIONS
mahoneypat
Microsoft Employee
Microsoft Employee

You can use a measure like this in a card visual to get your desired result.

 

Count Over 71 =
COUNTROWS (
    FILTER (
        VALUES ( 'report ConsumerTaskCodes'[ConsumerIdTaskcode] ),
        CALCULATE ( SUM ( 'report ConsumerTaskCodes'[confidenceScore] ) ) > 71
    )
)

 

If you already have a measre for confidence score, you can replace the CALCULATE expression with just [ConfidenceScoreMeasure]   (no CALCULATE needed if you use a measure).

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

@mahoneypat solution is the way to go. Just add zero logic for blanks if you want it. 

 

Your original post did not say that you want to do in Table A. Anyway,  since you said that you want to do the way in the link above, you can do like below

 

Desired Measure in A = 
var _ct = GROUPBY(TableA, TableA[ConsumerIdTaskcode], "Sum by ID", sumx(currentgroup(),TableA[confidenceScore]))
var _c = CALCULATE( DISTINCTCOUNT( TableA[ConsumerIdTaskcode]) , FILTER(_ct, [Sum by ID] > 71) )

RETURN IF( IsBlank(_c), 0, _c)

 

 

View solution in original post

5 REPLIES 5
mahoneypat
Microsoft Employee
Microsoft Employee

You can use a measure like this in a card visual to get your desired result.

 

Count Over 71 =
COUNTROWS (
    FILTER (
        VALUES ( 'report ConsumerTaskCodes'[ConsumerIdTaskcode] ),
        CALCULATE ( SUM ( 'report ConsumerTaskCodes'[confidenceScore] ) ) > 71
    )
)

 

If you already have a measre for confidence score, you can replace the CALCULATE expression with just [ConfidenceScoreMeasure]   (no CALCULATE needed if you use a measure).

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


sevenhills
Super User
Super User

I used your TableB

sevenhills_0-1629485576465.png

and wrote the measure (nothing different than what you have)

 

Desired Measure = 
var _c = CALCULATE(
    DISTINCTCOUNT(TableB[ConsumerIdTaskCode]), 
    filter( TableB, TableB[ConfidenceScore] > 71)
)

RETURN IF( IsBlank(_c), 0, _c)

it worked perfectly ... 

sevenhills_1-1629485609164.png

 

Anonymous
Not applicable

@sevenhills 

 

Please work with Tale A instead.

 

Olajumi_0-1629487227400.png

I am working with the raw data not aggregated. Hope you understand.

 

Anonymous
Not applicable

 

I saw an accepted solution and  I applied same method based on Solved: dax group by measure - Microsoft Power BI Community

 

But it is not working for me.  I have exact same issue.

 

Here is the dax I tried

 
measure  =
CALCULATE(DISTINCTCOUNT('report ProducerConsumerTaskCodes'[ConsumerIdTaskcode]),
FILTER(ALLSELECTED('report ProducerConsumerTaskCodes'),'report ProducerConsumerTaskCodes'[ConsumerIdTaskcode] = MAX('report ProducerConsumerTaskCodes'[ConsumerIdTaskcode])
&& 'report ProducerConsumerTaskCodes'[submissionMonth] = MAX('report producerConsumerExpenseCodes'[submissionMonth]
)))

 

I am getting null as answer.

 

Here is my csv file https://drive.google.com/file/d/1RWPdBo8_BcGwFILGRUtBe9x9p8XAWgc8/view?usp=sharing

 

@mahoneypat solution is the way to go. Just add zero logic for blanks if you want it. 

 

Your original post did not say that you want to do in Table A. Anyway,  since you said that you want to do the way in the link above, you can do like below

 

Desired Measure in A = 
var _ct = GROUPBY(TableA, TableA[ConsumerIdTaskcode], "Sum by ID", sumx(currentgroup(),TableA[confidenceScore]))
var _c = CALCULATE( DISTINCTCOUNT( TableA[ConsumerIdTaskcode]) , FILTER(_ct, [Sum by ID] > 71) )

RETURN IF( IsBlank(_c), 0, _c)

 

 

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.

Top Solution Authors