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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

SUM VALUES BASED ON A DISTINCT VALUE ON ANOTHER COLUMN

Hi all, 

 

I am sure you guys already resolved similar questions. 

 

I am looking at the following table (this is just a sample). I want to SUM the Rate_VS_Tipo and DISTINCT by Processo_SGC. 

What I want to achieve is get the SUM of the Rate, for each Processo_SGC where Processo_SGC must be a unique SUM. Meaning, in the below example the result would be 25,9. I am only getting the sum of all of them. Cheers

 
1.JPG

This isnt working: 
Preço (€) Distinct =
CALCULATE(SUM(t_Detalhe_Processos_Fases_Tarefas[Rate_VS_Tipo]);
FILTER (DISTINCT(
't_Detalhe_Processos_Fases_Tarefas');
't_Detalhe_Processos_Fases_Tarefas'[Rate_VS_Tipo]
)
)
1 ACCEPTED SOLUTION

Hi @Anonymous

Try this measure

Measure =
CALCULATE (
    SUM ( Sheet2[col2] ),
    FILTER (
        DISTINCT ( Sheet2 ),
        [col1] = MAX ( [col1] )
            && Sheet2[Tipo_Processo_SGC] IN { "INC1", "INC2" }
    )
)

If it doesn't work, please share the screenshot when you apply this measure in the table

 

Best Regards

Maggie

 
 

View solution in original post

5 REPLIES 5
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

you create a column as below, right?

5.png

 

I create a measure as above, is this what you want?

Measure = CALCULATE(SUM(Sheet2[col2]),FILTER(DISTINCT(Sheet2),[col1]=MAX([col1])))

If not, please let me know your expected result based on my example.

 

Best Regards

Maggie

 

Anonymous
Not applicable

Hi Maggie, 

 

Thank you so much!! I think that we got to the result, yes! 

Now, I'd like to add this filter, can you plesase let me know how I could possibly do this: 

FILTER (
't_Detalhe_Processos_Fases_Tarefas';
't_Detalhe_Processos_Fases_Tarefas'[Tipo_Processo_SGC]
IN {"INC1";"INC2"}
)
 

Hi @Anonymous

Try this measure

Measure =
CALCULATE (
    SUM ( Sheet2[col2] ),
    FILTER (
        DISTINCT ( Sheet2 ),
        [col1] = MAX ( [col1] )
            && Sheet2[Tipo_Processo_SGC] IN { "INC1", "INC2" }
    )
)

If it doesn't work, please share the screenshot when you apply this measure in the table

 

Best Regards

Maggie

 
 
Anonymous
Not applicable

Fantastic! 

Thank you very much. 

 

Anonymous
Not applicable

+++ And then I would like to filter it as well. 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.