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 the following table and I need DAX sentence to obtain the right table, that are the maximun values record of the left table.
Thanks in advance.
Hi @rbustamante ,
Try this:
Max value =
var _curId = MAX(SourceTable[ID]) //Get Current ID
var _curValue = MAX(SourceTable[Value]) //Get current value
var _calc = CALCULATE(MAX(SourceTable[Value]),FILTER(ALLEXCEPT(SourceTable,SourceTable[ID]), MAX(SourceTable[ID])=_curId))
Return
IF(_curValue = _calc,_calc)
If you leave off the value column, and just use the measure, you will get this.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
Thanks for the response.
What do you mean whe you said "If you leave off the value column, and just use the measure, you will get this."?
Hi @rbustamante ,
I created the table visual from the source table with 4 columns; Group, ID, Value, Max Value. The Max Value is the measure that I created. This shows all the values, and blanks in the measure column.
If you create the table with only Group, ID, and my measure Max Value you will see that the the reduced table with no blanks that more closely matches your table to the right of Desired Result. It just depends on what you want to show. A measure has a much smaller footprint than a calculated column. It just depends on what you are using these values to do.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
Please provide more information. Should this be a calculated column or a measure?
Here is how a calculated column would look like:
Include =
var m = CALCULATE(max('Table'[Value]),ALLEXCEPT('Table','Table'[Id]))
return if('Table'[Value]=m,1,0)
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 |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
44 | |
32 | |
30 | |
18 | |
17 |