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.
Hello
I need help running calculations on a live survey feed.
I have a table that will continuously add records to itself. I need to sum values but I can't sum in previous records for the same ID. For example, suppose I have the following table:
Name | Completed | Value |
Jon | 2/26/2018 | 2 |
Jacob | 2/25/2018 | 3 |
Jon | 2/24/2018 | 1 |
Jill | 2/26/2018 | 5 |
Jim | 2/26/2018 | 4 |
Jacob | 2/23/2018 | 4 |
For sums, I only want to sum the values for each name given the latest date for that name. The sum I want returned is:
Jon = 2
Jacob = 3
Jill = 5
Jim = 4
Total = 14
Average = 3.5
Thanks,
ajmonster
PS Bonus points if you can somehow create a table comprised of the unique Names and have their records update when the master query has a more recent record.
Solved! Go to Solution.
The Bonus points :
Go to Modeling- New Table
Table = SUMMARIZECOLUMNS ( Table1[Name]; "Lastrecord"; MAX ( Table1[Completed] ); "Value"; CALCULATE ( SUM ( Table1[Value] ); FILTER ( Table1; Table1[Completed] = MAX ( Table1[Completed] ) ) ) )
Regards
Victor
Lima - Peru
The Bonus points :
Go to Modeling- New Table
Table = SUMMARIZECOLUMNS ( Table1[Name]; "Lastrecord"; MAX ( Table1[Completed] ); "Value"; CALCULATE ( SUM ( Table1[Value] ); FILTER ( Table1; Table1[Completed] = MAX ( Table1[Completed] ) ) ) )
Regards
Victor
Lima - Peru
Is there a way to merge all the columns from Table1 (in my exact case, I have 40 columns) into this created Table?
Hi, i'm not sure that can be possible without reference all the columns that you want to summarize.
@Vvelarde This is it. Thank you.
Would I be able to use SELECTEDVALUE ( Table1[Value] ) instead of SUM( Table1 [Value] ) to select the field Value in the case that there are two records under the same [Name] and same [Completed] date?
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |