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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
DiePic
Resolver II
Resolver II

SUM a measure

Hi all,
I've this measure (last column) 

DiePic_1-1696865602700.png

 


and this is the code of the measure:

Tempo_Risposta_Concordato_Count =
//
  VAR ReplyTime = VALUE(SELECTEDVALUE(Ticket_Data[TktTempoAccettazione]))
  //
    VAR Filtra =
    IF(ReplyTime < 61
      , 0
      ,IF([Tempo_Risposta_Concordato] = 0
        ,0
        ,IF(([Tempo_Risposta_Concordato] - ReplyTime) >= 0
          ,0
          ,1
        )
      )
    )  
VAR Result = VALUE(Filtra)
RETURN Result

as highlighted in red, I have not found a formula to sum my measure .... I tried all the ways shown in the figure below
DiePic_2-1696865724754.png

If somebody can give me help or give some idea ... it will be appreciated

 



1 ACCEPTED SOLUTION
DiePic
Resolver II
Resolver II

If can be useful for someone, this is my solution:

SUMX( VALUES('table'[id]) ,[MyMeasure])

View solution in original post

4 REPLIES 4
DiePic
Resolver II
Resolver II

If can be useful for someone, this is my solution:

SUMX( VALUES('table'[id]) ,[MyMeasure])

@DiePic Yep, you got it, would be the equivalent of this using a more generalized method (below). Also, you might consider using DISTINCT instead of VALUES. VALUES has a nasty habit of returning a blank row when you have unmatched keys in a relationship.

SUMX( SUMMARIZE('table', [id], "__MyMeasure", [MyMeasure]), [MyMeasure] )

The advantage of this generalized approach is that one, SUMMARIZE tends to be crazy fast. Two, if you need to "group" by more than one thing, SUMMARIZE can do this while just using DISTINCT or VALUES cannot.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@DiePic This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler thank you for your suggestion.
This is really over my knowledge ... can you help me more please?
I try:

MAXX(SUMMARIZE ( Ticket_Data, Ticket_Data[TktTempoAccettazione] , "Measure",[Tempo_Risposta_Concordato_Count] ), [Measure])
but its not working

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.