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
Anonymous
Not applicable

TOPN in Calculated Column

Aim:
I need to generate a calculated column that show the SUM of the last 6 results by person. 

Context:
Ordinarily do this as a measure, however, due to needing to put the result ( % Diff of Most Recent to Avg of Last 6) in a box and whisker plot it has to be as a calculated column. 

 

Intended Outcome:

NameMost Recent ResultSUM of Last 6AVG of Last 6% Diff of Most Recent to Avg of Last 6
Bob45.91259.1543.026.5%


Data Structure:

heastham_0-1666259612322.png

  • The relationship between the two tables is on the FT_PlayerID. 
  • The Box & Whisker CMJ Table has been calculated as a summary table with the following DAX: 

 

Box & Whisker CMJ = 
SUMMARIZE(
    'CMJ Results',
    'CMJ Results'[PlayerName],
    Players[FT_PlayerId],
    "Most Recent CMJ", CALCULATE(MAX('CMJ Results'[Max Height]),LASTDATE('CMJ Results'[SessionDate])),
    "Most Recent Session",MAX('CMJ Results'[SessionDate])
)

 

  • The player Index Number in the CMJ results table assigns a sub index so each player's test has an index number - this is so I can calulcate the TOPN off.

Many thanks in advance! 

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

What is your table "CMJ Results" looks like?

Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?

Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors