The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
I am looking for some help to tweak a Measure I have that isn't quite working. I am a bit of a novice so I apologies in advance for any incorrect terminolgy or just poor explainations.
My data is Football/Soccer and what I am trying to acheive is having a rolling Average of Goals scored per Player by IndexNumber. All my data is in a table called MatchData1.
I currently have this measure;
4GameGPG measure =
VAR __Index = MAX(MatchData1[Rank])
VAR __MinIndex = __Index - 3
VAR __Table = FILTER(ALLSelected(MatchData1), MatchData1[Rank]<= __Index && MatchData1[Rank] >= __MinIndex)
RETURN
AVERAGEX(__Table,[Goals])
The measure currently works if I only have 1 person selected in my visual(table). When I select more than 1 person then gives each person the same average for each Rank. I believe I need the Var__Table section of the code to be amended but this is where I am stuck.
Just for reference, here is my Rank DAX;
Rank =
VAR d = MatchData1[Date]
VAR c = MatchData1[Players]
RETURN
CALCULATE (
RANK.EQ ( d, MatchData1[Date], Asc ),
FILTER ( ALL ( MatchData1 ), MatchData1[Players] = c )
)
Any help would be really appreciated 🙂.
Thanks,
Gavin
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |