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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
GuilhermeDoeli
New Member

Total value of table wrong based on summarized rows

Hi everybody! May someone help me with dax formula for this problem please? I tried so much but i cant resolve that...

GuilhermeDoeli_0-1687013107972.png


I have this table with three columns (MATRICULA, PONTOS, ID). My objective is to create a dax formula that sum the total amount of PONTOS of the last interview  of a client (highest ID_ENTREVISTA) for each client (MATRICULA_BENEFICIARIO).

So the formula should return: 40 + 25 + 0 +80 + 90 + 100 = 335

I tried this dax fórmula: 

GuilhermeDoeli_1-1687013386931.png

and it partially worked:

GuilhermeDoeli_3-1687013543722.png

The formula brings the last interview of each client, but doesnt sum correctly. Instead of "90" the total should be "335".
I tried alot of different formulas but i cant get the correct sum.

May someone help me please?

2 REPLIES 2
devanshi
Helper V
Helper V

Total = SUMMARIZE(Tablename, " ",
                                       CALCULATE(
                                                            SUM([ PONTOS  PPS]), ALLEXCEPTED(Tablename,[MATRICULA],                                                                                      [ID_ENTREVISTAID_ENTREVISTA] = MAX([ID_ENTREVISTA]))
                                                             )
                                 )

barritown
Super User
Super User

Hi @GuilhermeDoeli,

If it is okay to replace BLANK with a zero, you can use the approach below:

barritown_0-1687250034728.png

In plain text:

MEDIA Pontos totals = 
VAR _tbl = SUMMARIZE ( 
            data, data[BENEFICIARIO],
            "Totals", 
            VAR CurrentBENE = [BENEFICIARIO]
            VAR MaxID = MAXX ( FILTER ( data, data[BENEFICIARIO] = CurrentBENE ), [ID] )
            RETURN MINX ( FILTER ( data, data[BENEFICIARIO] = CurrentBENE && data[ID] = MaxID ), [Pontos] ) )
VAR Res = SUMX ( _tbl, [Totals] )
RETURN COALESCE ( Res, 0 )

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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