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.
Hello,
I have a column 'X' with numerical values in it and another column 'Y' with text in it. In column 'Y' it will either contain the text 'A', 'B' or 'C'. I want to return the maximum value from column 'X' but with a filter so it only considers values where there is an 'A' in the row from the 'Y' column.
In power query I added a custom column with the formula:
IF text.contains([Y], "A") then [X] else 0
But when I then create a new measure with the DAX function 'MAX' for my new custom column it doesn't return the maximum value. It returns 98 when the actual max value is 1200. Is there a reason why it isn't searchin the whole column? When I look through my custom column in power query i can see a lot of numbers bigger than 98, but all of these seem to be ignored.
Can anyone help with this?
Solved! Go to Solution.
Hi @Anonymous ,
Try this measure
Max Value =
CALCULATE(
MAX('Table'[X]),'Table[Y] = "A")
)
Regards,
Harsh Nathani
Hi @Anonymous ,
Try this measure
Max Value =
CALCULATE(
MAX('Table'[X]),'Table[Y] = "A")
)
Regards,
Harsh Nathani
@Anonymous
I am not sure about your Power Query code
It easy to add the Column that gives you the MAX by category in the model than in Power Query.
Add the following column: DAX
Max Value =
CALCULATE(
MAX('Table'[x]),
ALLEXCEPT('Table','Table'[y])
)
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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 |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
18 |