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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Heonsang
Frequent Visitor

Sum of Time visible in table visual

I'm getting a lot of helps from this community and need your help again 🙂

 

I'm trying to sum duration in unique values in the table.

In the following example, what I want is Duration of Avengers + Duration of Black Panther and Duration of Captain marvel = 1:19:00. But it is giving me sum of all durations when I use SUM function and I don't have any record to filter here. Is it possible to sum only unique values?

 

Program | Duration | Transmitted Date

Avengers | 0:22:00 | 3/1/2018

Avengers | 0:22:00 | 3/3/2018

Black Panther | 0:25:00 | 2/6/2018

Captain Marvel | 0:32:00 | 7/2/2018

Captain Marvel | 0:32:00 |3/8/2018

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Heonsang,

 

I made one sample for your reference.

 

1. Enter the data and create the measures as below.

 

Measure =
IF (
    MAX ( Table1[Transmitted Date] )
        = CALCULATE (
            MAX ( Table1[Transmitted Date] ),
            ALLEXCEPT ( Table1, Table1[Program] )
        ),
    1,
    0
)
Measure 3 = 
VAR y =
    IF (
        MAX ( Table1[Transmitted Date] )
            = CALCULATE (
                MAX ( Table1[Transmitted Date] ),
                ALLEXCEPT ( Table1, Table1[Program] )
            ),
        1,
        0
    )
RETURN
    FORMAT(CALCULATE ( SUM ( Table1[Duration.1] ), FILTER ( Table1, [Measure] = 1 ) ),"hh:mm:ss")

2. Then we can get the result as we excepted.

Capture.PNG

For more details, please  check the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Heonsang,

 

Does that make sense? If so, kindly mark my answer as a solution to close the case.

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
v-frfei-msft
Community Support
Community Support

Hi @Heonsang,

 

I made one sample for your reference.

 

1. Enter the data and create the measures as below.

 

Measure =
IF (
    MAX ( Table1[Transmitted Date] )
        = CALCULATE (
            MAX ( Table1[Transmitted Date] ),
            ALLEXCEPT ( Table1, Table1[Program] )
        ),
    1,
    0
)
Measure 3 = 
VAR y =
    IF (
        MAX ( Table1[Transmitted Date] )
            = CALCULATE (
                MAX ( Table1[Transmitted Date] ),
                ALLEXCEPT ( Table1, Table1[Program] )
            ),
        1,
        0
    )
RETURN
    FORMAT(CALCULATE ( SUM ( Table1[Duration.1] ), FILTER ( Table1, [Measure] = 1 ) ),"hh:mm:ss")

2. Then we can get the result as we excepted.

Capture.PNG

For more details, please  check the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.