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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Bats
Frequent Visitor

Calculating the sum of a value based on the minimum date for each value in another column

Not sure if this makes sense...

 

For example, looking to get the total points a player scored on the first date that player scored points for each player in the table.

 

Then looking to have a graph which would compare each players total points on the first day, second day, third day etc.  So the graph stores the minimum dates as the same value, despite each players potentially being different.

 

Not sure if this is even possible at all but thought I'd give this a try anyway!

11 REPLIES 11
amitchandak
Super User
Super User

Create a rank column like this

Rank = RANKX(all(Table[player]),Table[date],,DESC,asc)

 

This will act like 1,2,3 day for each play. Now you can compare them

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandakafraid that formula does not work!

can you provide some data or dummy data?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg  Not sure if this helps?

Sample Data:

Sample DataSample Data

 

Sample Results:

SampleResults.PNG

 

it will but better if you provided it in text form?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg  sorry!

 

PlayersPointsDate
a3121/10/2019
b2015/08/2019
c6131/01/2020
b2707/09/2019
c4008/01/2020
b9006/10/2019
b5716/12/2019
b4623/11/2019
b3721/08/2019
a5206/12/2019

 

PlayersPointsDay
a311
b201
c401
a522
b372
c612

 

Also the results should continue on for each day after when the player scores points

@Bats  not sure if this helps

 

Rank = RANKX(CALCULATETABLE(Players|ALLEXCEPT(Players|Players[Players]))
|CALCULATE(SUM(Players[Points])))
 
Capture.PNG




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg  It's close although didn't quite work with my actual dataset as all the players had the same rank for some reason. But did work in the sample dataset. However, would it be possible to get the RANK as row/column/to be used as an axis?

@Bats  can you give me an idea of how you using this, or show me, its hard to do this without all the information maybe just screen shot an example or show me what you expecting with the fields





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




vanessafvg
Super User
Super User

@Bats  definitely think it would be possible as long as model your data correctly, and store the right amount of data.  Incuding things like date table.   

 

what is your data model?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg  Using SSAS tabular model. Has Date table, Player table, and a Points table. Points table containing DateIDs and PlayerIDs.

 

Thanks!

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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