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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Jeff_Ng
Frequent Visitor

Filter a table to return a table with distinct id.

How can I transform below the "Input Table" to look like the "Output Table" using DAX in Powe BI?

 

First I need to retrieve maximum number from each 'risk_score_X' then sum them up to produce 'Max_total_score' then return a single row for each 'project_id'. 

 

Your helps will be very much appreciated. Thanks.

 

Input Table    
project_idrisk_score_1risk_score_2risk_score_3risk_score_4total_score
20AB12310012
20AB12302103
20AB12311305
20AB12301045
30AB45610012
30AB45602103
30AB45611507
30AB45601056
      
      
Output Table    
project_idMax_of_risk_score_1Max_of_risk_score_2Max_of_risk_score_3Max_of_risk_score_4Max_of_total_score
20AB123123410
30AB456125513
1 ACCEPTED SOLUTION
shinnes
Frequent Visitor

Hello,

 

I am no expert, but how about something like this:

 

Summarized =
ADDCOLUMNS (
SUMMARIZE (
Table1,
Table1[project_id],
"Max_of_risk_score_1", CALCULATE ( MAX ( Table1[risk_score_1] ) ),
"Max_of_risk_score_2", CALCULATE ( MAX ( Table1[risk_score_2] ) ),
"Max_of_risk_score_3", CALCULATE ( MAX ( Table1[risk_score_3] ) ),
"Max_of_risk_score_4", CALCULATE ( MAX ( Table1[risk_score_4] ) )
),
"total_score", [Max_of_risk_score_1] + [Max_of_risk_score_2]
+ [Max_of_risk_score_3]
+ [Max_of_risk_score_4]
)

 

Perhaps someone else can recommend a simpler way to do.

View solution in original post

2 REPLIES 2
shinnes
Frequent Visitor

Hello,

 

I am no expert, but how about something like this:

 

Summarized =
ADDCOLUMNS (
SUMMARIZE (
Table1,
Table1[project_id],
"Max_of_risk_score_1", CALCULATE ( MAX ( Table1[risk_score_1] ) ),
"Max_of_risk_score_2", CALCULATE ( MAX ( Table1[risk_score_2] ) ),
"Max_of_risk_score_3", CALCULATE ( MAX ( Table1[risk_score_3] ) ),
"Max_of_risk_score_4", CALCULATE ( MAX ( Table1[risk_score_4] ) )
),
"total_score", [Max_of_risk_score_1] + [Max_of_risk_score_2]
+ [Max_of_risk_score_3]
+ [Max_of_risk_score_4]
)

 

Perhaps someone else can recommend a simpler way to do.

Really appreciate your help Sinnes. You are absolutely genius. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

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.