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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

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
ebeery
Memorable Member
Memorable Member

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
ebeery
Memorable Member
Memorable Member

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 Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.