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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
yios
Helper I
Helper I

Sumx a column's value only once based on business logic

Hi all,

I have a question regarding the following requirement.

First of all data is like below

 

DayDutyTaskDutyStartsDutyEndsDutyDurationHrs
1D1T19:0011:002
1D1T29:0011:002
2D1T114:0019:005
2D1T214:0019:005
2D1T314:0019:005
3D1T19:0011:002
3D1T29:0011:002

 

In a visual table there will be the column Duty and then i want to display a measure which will show sum of DutyDurationHrs for all Days that this Duty exists. 

Regarding above dataset i would like to show

Duty      DutyDurationHours

D1         9

 

I mean that for each Day that this Duty exists, i want to extract the value of DutyDurationHrs only once and finally to sum all of them (for example in Day1 -> D1 duration was 2 Hrs, in Day2 -> D1 duration was 5 Hrs, in Day3 -> D1 duration was 2 Hrs, 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@yios 

 

Try this MEASURE

 

Measure =
SUMX (
    VALUES ( TableName[Day] ),
    CALCULATE ( AVERAGE ( TableName[DutyDurationHrs] ) )
)

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@yios 

 

Try this MEASURE

 

Measure =
SUMX (
    VALUES ( TableName[Day] ),
    CALCULATE ( AVERAGE ( TableName[DutyDurationHrs] ) )
)

Thanks @Zubair_Muhammad 

 

It works!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors