Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'm looking to calculate a Positional Max for Jump Height. On the report I have a slicer for 'Player Name'. I have used the following DAX to calculate a MAX value, removing the filters for 'Date' and 'Player Name'.
Hi @KMichael99
Did you get your problem solved? If not, please provide detailed sample data and your expected results. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.
Best Regards,
Community Support Team _Yuliax
It looks like you want to calculate the positional max for jump height, considering the 'Position Lookup' measure while keeping the dashboard user-friendly without adding a slicer for 'Position Group'. You can achieve this by using the CALCULATETABLE function to create a virtual table that includes the necessary filters.
Here's an example of how you might modify your DAX measure:
Positional Max CMJ Jump Height =
CALCULATE(
MAX(CMJ[Jump Height (Imp-Mom) [cm]]),
REMOVEFILTERS('Calendar Reference'[Date]),
TREATAS(VALUES('Player Reference'[Player Name]), 'Player Reference'[Player Name]),
TREATAS(VALUES('Position Lookup'[Position Group]), 'Position Lookup'[Position Group])
)
In this modified measure:
This way, you consider both the 'Player Name' and its associated 'Position Group' in the calculation, while still removing the filter on 'Date'. The TREATAS function is used to apply these virtual tables as filters.
Please adapt the measure based on your data model and relationships, and make sure to test it thoroughly to ensure it meets your requirements.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
Hi,
Thanks for your reply.
It seems as if I can't do the following: TREATAS(VALUES('Position Lookup'[Position Group]), 'Position Lookup'[Position Group]).
This is becuase the 'Position Lookup'[Position Group]) is not a TableNameOrColumnName. It is a Measure.
Any solutions to this?
Thanks
Ah, I understand the challenge now. If Position Lookup is a measure and not a direct column reference, then you cannot use it directly within the TREATAS function as you've tried.
To address this, you can create a new calculated column in your data model (perhaps within the 'Player Reference' table) that uses the Position Lookup measure to get the Position Group for each player. Once you have this new calculated column, you can then use it to filter or adjust your measures.
Here's a step-by-step guide:
Create a New Calculated Column:
You can create a new calculated column in the 'Player Reference' table that fetches the 'Position Group' based on the 'Player Name' using the Position Lookup measure. The formula would look something like:
Position Group Column = [Position Lookup]
When you add this column to your table, it will dynamically fetch the 'Position Group' for each player name based on the measure's logic.
Modify Your Measure:
After creating the new calculated column, you can modify your DAX measure to incorporate this column for filtering:
Positional Max CMJ Jump Height =
CALCULATE(
MAX(CMJ[Jump Height (Imp-Mom) [cm]]),
ALL('CMJ'),
'CMJ'[Player Name] IN VALUES('Player Reference'[Player Name]),
'CMJ'[Position Group] = 'Player Reference'[Position Group Column]
)
Here:
By creating the calculated column, you essentially move the logic from a measure to the data model, making it easier to incorporate within your DAX formulas.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
12 | |
10 | |
10 | |
6 |