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
Riddler
Frequent Visitor

Rolling weighted value (other column) for project (aggregating the last timestamps of subprojects)

Hi, I am aggregating data for development projects. These projects consist of different repositories, which give me metadata for timestamps when scanning the current status of a repository. (example of result table in answers)

 

repo.repositoryNamerepo.uidrepo.locrepo.scantimestamprepo.overallRatingrepo.locXOverallRating
Kafka7918f57464e4595884652054b12f173513697029.04.2019 14:302,79480764,7
lgvf0498d40214513effa4c415c83a161c611161829.04.2019 14:27-0,23558090
skywalking (incubating)287505f3cf5bbb213de83cd54f76a5be1236129.04.2019 12:503,6855624,5
hbaseb90a7ac3118f6ecfa4537f1ab359bc5b13602329.04.2019 12:351,58446155,44
Kafka7918f57464e4595884652054b12f173513697029.04.2019 12:292,78495831,4
Kafka7918f57464e4595884652054b12f173513697018.04.2019 17:542,23398582,7
angular TSb40909083e1a671f8a9a16f51a2fffa18618318.04.2019 12:393,96430915
three56c65bdac0fd8f8797d3e0ae7bf261e0152118.04.2019 12:391,97605
Visual Studio59316bad6ca2c1874312a351ef41841310553318.04.2019 09:122,13525554,34
three56c65bdac0fd8f8797d3e0ae7bf261e0152118.04.2019 09:111,877605
hbaseb90a7ac3118f6ecfa4537f1ab359bc5b13602316.04.2019 15:161,73457037,28
skywalking (incubating)287505f3cf5bbb213de83cd54f76a5be1236116.04.2019 15:153,6855624,5
skywalking (incubating)287505f3cf5bbb213de83cd54f76a5be1236116.04.2019 15:133,6855624,5
hbaseb90a7ac3118f6ecfa4537f1ab359bc5b13602316.04.2019 15:022,07433913,37
hbaseb90a7ac3118f6ecfa4537f1ab359bc5b13602312.04.2019 10:101,7429832,68
skywalking (incubating)287505f3cf5bbb213de83cd54f76a5be1236112.04.2019 10:062,2955253,67
hbaseb90a7ac3118f6ecfa4537f1ab359bc5b13602312.04.2019 09:551,97412149,69
skywalking (incubating)287505f3cf5bbb213de83cd54f76a5be1236112.04.2019 09:542,2955253,67
hivemall(incubating)7a85ba7f87011d452677ec51686f0e2c6925812.04.2019 09:502,77304735,2
skywalking (incubating)287505f3cf5bbb213de83cd54f76a5be1236112.04.2019 09:452,9153275,91
hivemall(incubating)7a85ba7f87011d452677ec51686f0e2c6925812.04.2019 09:432,82307505,52
skywalking (incubating)287505f3cf5bbb213de83cd54f76a5be1236112.04.2019 09:391,9238566,32
hivemall(incubating)7a85ba7f87011d452677ec51686f0e2c6925812.04.2019 09:372,8306120,36
skywalking (incubating)287505f3cf5bbb213de83cd54f76a5be1236112.04.2019 09:192,9554264,79
hivemall(incubating)7a85ba7f87011d452677ec51686f0e2c6925812.04.2019 09:182,94310275,84
lgvf0498d40214513effa4c415c83a161c611161810.04.2019 17:20-0,23558090
ol-cesiumb5b06cbae1ecb58dc86bcebcf99bb8bf491110.04.2019 16:522,3424555
lgvf0498d40214513effa4c415c83a161c611161810.04.2019 15:28-0,31558090
Kafka7918f57464e4595884652054b12f173513697009.04.2019 20:522,92512267,8
Kafka7918f57464e4595884652054b12f173513697009.04.2019 20:332,24399952,4

 

Then I have another Table for the projects and their consisting repos. Including sumloc what is the size of the complete project and repoloc what is the size of the referenced repo.

 

projectdetails.sumlocprojectdetails.projectIdprojectdetails.repositoryCountprojectdetails.projectNamerepositoryIdrepositoryNameuidprojectdetails.repoloc
11652922GeoMaster3lgvf0498d40214513effa4c415c83a161c6111618
11652922GeoMaster4ol-cesiumb5b06cbae1ecb58dc86bcebcf99bb8bf4911
13697011Kafka1Kafka7918f57464e4595884652054b12f1735136970
21764233Trends8hbaseb90a7ac3118f6ecfa4537f1ab359bc5b136023
21764233Trends5hivemall(incubating)7a85ba7f87011d452677ec51686f0e2c69258
21764233Trends6skywalking (incubating)287505f3cf5bbb213de83cd54f76a5be12361

 

I have in repo.overallRating values between 5 and -5 for the repositories for different timestamps. 

Since I just get a new scan/timestamp if any changes are done in a repository I might only get a timestamp of some repo every x month, while the rest of the repositories are constantly creating timestamps.

 

Repo.loc is the size.

Repo.overall is the score.

 

I want to SUM(repo.overallRating*repo.loc)/projectdetailssumloc)  in each project. But it has to just take the last timestamps into account available. 

So that a project consisting of repos a, b and c the last timestamp of each of these repos is used in the formula. 

 

By this I get a weighted (after size) overall.rating for my projects that I can plot over a timeline, for trend analytics. 

 

Thank you for your help community. I am struggling with this since hours....

2 REPLIES 2
Greg_Deckler
Super User
Super User

Any chance you could post what your expected output would be from the data provided?

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  Of course, my apologies.

In the meanwhile, I created a right join to connect project data with repo timestamp data.

So all fields you see here are available (more but that is just noise for this topic)

This would be the output for the Project named Trends

It is filtered on Trends and should ignore the other 4 projects and vice versa. For this I created the column 

repositories.

repo.uid+project.id

That is unique in each project, allowing two projects to use the same repositories. So

repositories.

repo.uid+project.id

we can use for a DISTINCT Filter and I guess we can use an EARLIER to get those numbers together. It is a accumulated Value like here https://community.powerbi.com/t5/Desktop/Accumulate-added-value/td-p/82382 but I need it to MAX it to the number of unique values of 

repositories.

repo.uid+project.id that are above it. 

Similar to this https://stackoverflow.com/questions/51353339/measure-to-sum-of-more-recent-values-using-dax-from-pow...

 

I wrote down the formular for each line in the RollingOverallRating in Excel (scroll right)

project

details.

projectId

project

details.

sumloc

project

details.

repository

Count

project

details.

project

Name

repositories.

repo.

repositoryName

repositories.

repo.uid+project.id

repositories.

repo.loc

repositories.

repo.

scantimestamp

repositories.

repo.overallRating

Rolling

Overallrating

32276613Trendshivemall(incubating)37a85ba7f87011d452677ec51686f0e2c6925812.04.2019 09:182,94((2,94*69258))/(69258)
32276613Trendsskywalking (incubating)3287505f3cf5bbb213de83cd54f76a5be2238012.04.2019 09:192,95((2,94*69258)+(2,95*22380))/(69258+22380)
32276613Trendshivemall(incubating)37a85ba7f87011d452677ec51686f0e2c6925812.04.2019 09:372,8((2,80*69258)+(2,95*22380))/(69258+22380)
32276613Trendsskywalking (incubating)3287505f3cf5bbb213de83cd54f76a5be2238012.04.2019 09:391,92((2,80*69258)+(1,92*22380))/(69258+22380)
32276613Trendshivemall(incubating)37a85ba7f87011d452677ec51686f0e2c6925812.04.2019 09:432,82((2,82*69258)+(1,92*22380))/(69258+22380)
32276613Trendsskywalking (incubating)3287505f3cf5bbb213de83cd54f76a5be2238012.04.2019 09:452,91((2,82*69258)+(2,91*22380))/(69258+22380)
32276613Trendshivemall(incubating)37a85ba7f87011d452677ec51686f0e2c6925812.04.2019 09:502,772,652773522
32276613Trendsskywalking (incubating)3287505f3cf5bbb213de83cd54f76a5be2238012.04.2019 09:542,29((2,77*69258)+(2,29*22380))/(69258+22380)
32276613Trendshbase3b90a7ac3118f6ecfa4537f1ab359bc5b13602312.04.2019 09:551,97((2,77*69258)+(2,29*22380)+(1,97*136023))/(69258+22380+136023)
32276613Trendsskywalking (incubating)3287505f3cf5bbb213de83cd54f76a5be2238012.04.2019 10:062,29((2,77*69258)+(2,29*22380)+(1,97*136023))/(227661)
32276613Trendshbase3b90a7ac3118f6ecfa4537f1ab359bc5b13602312.04.2019 10:101,7((2,77*69258)+(2,29*22380)+(1,7*136023))/(227661)
32276613Trendshbase3b90a7ac3118f6ecfa4537f1ab359bc5b13602316.04.2019 15:022,07((2,77*69258)+(2,29*22380)+(2,07*136023))/(227661)
32276613Trendsskywalking (incubating)3287505f3cf5bbb213de83cd54f76a5be2238016.04.2019 15:133,68((2,77*69258)+(3,68*22380)+(2,07*136023))/(227661)
32276613Trendsskywalking (incubating)3287505f3cf5bbb213de83cd54f76a5be2238016.04.2019 15:153,68((2,77*69258)+(3,68*22380)+(2,07*136023))/(227661)
32276613Trendshbase3b90a7ac3118f6ecfa4537f1ab359bc5b13602316.04.2019 15:161,73((2,77*69258)+(3,68*22380)+(1,73*136023))/(227661)
32276613Trendshbase3b90a7ac3118f6ecfa4537f1ab359bc5b13602329.04.2019 12:351,58((2,77*69258)+(3,68*22380)+(1,58*136023))/(227661)
32276613Trendsskywalking (incubating)3287505f3cf5bbb213de83cd54f76a5be2238029.04.2019 12:503,682,14845494
32276613Trendsskywalking (incubating)3287505f3cf5bbb213de83cd54f76a5be2238029.04.2019 18:053,572,137641493
32276613Trendsskywalking (incubating)3287505f3cf5bbb213de83cd54f76a5be2238030.04.2019 09:563,632,143539737

The unfiltered table has of course more projects. But to much chars for this post.

*edit, table had been a row off

Thanks in advance!

Greets

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.