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 have a problem that is equivalent to the following. I run a bowling alley, and I want to create a dashboard showing recent scores. I have a table with their names, dates, and scores and I'd like to make a summary showing only the most recent score for each bowler.
A possible example of the data is:
Name | Date | Score |
Steve | 7/12/2021 | 300 |
Richard | 6/12/2021 | 100 |
Steve | 6/12/2021 | 250 |
Steve | 5/12/2021 | 270 |
Bob | 5/12/2021 | 120 |
Steve | 4/12/2021 | 270 |
Bob | 4/12/2021 | 130 |
Richard | 4/12/2021 | 110 |
Steve | 3/12/2021 | 290 |
Steve | 2/12/2021 | 280 |
Bob | 2/12/2021 | 140 |
Richard | 1/12/2021 | 120 |
My desired output would be:
Name | Date of last bowl | Most recent score |
Bob | 5/12/2021 | 120 |
Richard | 6/12/2021 | 100 |
Steve | 7/12/2021 | 300 |
Thanks to the help from this community I was able to creating two measures to solve this problem (in most cases):
Is there any way to force 'latestscore' to only output one value? I've tried a few things but none have worked so far.
I've attached the pbix file with and without the error (i.e. with and without duplicate dates)
Many thanks for your help! 🙂
This is a follow on from my earlier question here: Create table of most recent results
Solved! Go to Solution.
@benh66 here is your measure:
Measure 2 =
VAR __table = CALCULATETABLE ( ALLSELECTED ( Bowling ), VALUES ( Bowling[Name] ) )
Var __date = CALCULATE( MAX(Bowling[ Date] ), __table )
RETURN
CALCULATE ( SUM ( Bowling[Score] ), __table, Bowling[ Date] = __date )
✨ Follow us on LinkedIn
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
PBIX file with error - https://drive.google.com/file/d/1jfMZQiBsBh_fvdPMKSIpqCX5ytlj2jRF/view?usp=sharing
PBIX file with no error - https://drive.google.com/file/d/1XMgmvs0QJ5zw06rFHmKz0M_x-YOdIJQs/view?usp=sharing
✨ Follow us on LinkedIn
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@benh66 here is your measure:
Measure 2 =
VAR __table = CALCULATETABLE ( ALLSELECTED ( Bowling ), VALUES ( Bowling[Name] ) )
Var __date = CALCULATE( MAX(Bowling[ Date] ), __table )
RETURN
CALCULATE ( SUM ( Bowling[Score] ), __table, Bowling[ Date] = __date )
✨ Follow us on LinkedIn
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks! Worked perfectly 🙂
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 |
---|---|
114 | |
105 | |
79 | |
68 | |
63 |
User | Count |
---|---|
148 | |
107 | |
106 | |
82 | |
70 |