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.
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
Solved! Go to Solution.
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.
For more details, please check the pbix as attached.
Regards,
Frank
Hi @Heonsang,
Does that make sense? If so, kindly mark my answer as a solution to close the case.
Regards,
Frank
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.
For more details, please check the pbix as attached.
Regards,
Frank
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
96 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |