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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
kala2
Helper III
Helper III

Distinct and Sum multiple columns

I want to distinct rows and the sum each row certain columns:

 

kala2_0-1627637873717.png

 

So i want to distinct the rows by Projekt ID and then sum the columns:

OFFEN - in Verzug

OFFEN - planmäßig

OFFEN - Start überfällig

IN ARBEIT - in Verzug

IN ARBEIT - planmäßig,

ABGESCHLOSSEN

 

I have this measure now for one column: 

 

SumDistinctPT = SUMX(DISTINCT('Table'[Projekt ID]), FIRSTNONBLANK('Table'[ABGESCHLOSSEN], 0))
which returns 24 result correctly

Expected sum to return for all distincted rows is: 133 (Sum of all distincted rows of the specific columns)
 
Any ideas how to distinct and sum multiple columns?
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @kala2, how about something like the below.

SumDistinctAllColumns =
VAR _DistinctTable =
    SUMMARIZECOLUMNS (
        [OFFEN - in Verzug],
        [OFFEN - planmäßig],
        [OFFEN - Start überfällig],
        [IN ARBEIT - in Verzug],
        [IN ARBEIT - planmäßig],
        [ABGESCHLOSSEN]
    )
VAR _Result =
    SUMX (
        _DistinctTable,
        [OFFEN - in Verzug] + [OFFEN - planmäßig] + [OFFEN - Start überfällig] + [IN ARBEIT - in Verzug] + [IN ARBEIT - planmäßig] + [ABGESCHLOSSEN]
    )
RETURN
    _Result

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @kala2, how about something like the below.

SumDistinctAllColumns =
VAR _DistinctTable =
    SUMMARIZECOLUMNS (
        [OFFEN - in Verzug],
        [OFFEN - planmäßig],
        [OFFEN - Start überfällig],
        [IN ARBEIT - in Verzug],
        [IN ARBEIT - planmäßig],
        [ABGESCHLOSSEN]
    )
VAR _Result =
    SUMX (
        _DistinctTable,
        [OFFEN - in Verzug] + [OFFEN - planmäßig] + [OFFEN - Start überfällig] + [IN ARBEIT - in Verzug] + [IN ARBEIT - planmäßig] + [ABGESCHLOSSEN]
    )
RETURN
    _Result

Thanks! working perfectly!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors