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

Get the max Value within a measure

Hey guys, can you help me on this one,

 

I got a measure [Sum LOS] that is the result of summing a logical colomn, and the total value of true values,

With this values I calculate the percentage of values in the measure [Q2 OS%].

They are ordered by the [Group], and the group has different [values]

I need to put on the right table the value of the groups, and it has to be the biggest [value] (12.43%), and not the average of both values (10.59%)

 

MarvinConceição_0-1592837080116.png

 

can you help me with this one,

Thanks

1 ACCEPTED SOLUTION

@MarvinConceição try this

 

Max Average = 
MAXX ( SUMMARIZE ( Table, Table[Group], Table[Value],  "_Avg", [Your Measure] ),
[_Avg]
)

make sure to change the table and column name as per your model, change commas to semicolons.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

14 REPLIES 14
parry2k
Super User
Super User

@MarvinConceição try this measure

 

Max Average = 
MAXX ( VALUES ( Table[Group] ), [Average Measure] )

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hey @parry2k , thanks for the fast reply

I don't know if i understood your answer, i tried following ut tip

Max Average =
MAXX ( VALUES ( 'Table'[Group] ), [Q2 OS%] )
 
But I get the
unexpected expression '[Q2 OS%]'
error

@MarvinConceição do you have this [Q2 OS%] measure already, correct?

 

Make sure to change Table[Group] with your table name and group column name that you used in the matrix.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

hey @parry2k, yes I did change, and this [Q2 OS%] is a measure

here is the original line 

 
 
 

Error.png

 

 

@MarvinConceição I guess it is a language issue, can you replace , with ; 

 

Do you use comma or semi colon in your DAX expressions?

 

Also can you confirm you have Q2 OS measure

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Oh! right, my bad, the comma was the issue, now it is running

MarvinConceição_0-1592839742362.png

But, what im trying to achieve is this

MarvinConceição_1-1592840124584.png

The second table need to show only the biggest percentage
sorry for all the trouble, I'm still new at this
thanks

@MarvinConceição try this

 

Max Average = 
MAXX ( SUMMARIZE ( Table, Table[Group], Table[Value],  "_Avg", [Your Measure] ),
[_Avg]
)

make sure to change the table and column name as per your model, change commas to semicolons.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k I just tried it, there was no error, but Im still with the 10.59% instead of 12.43%

Sum Max Average =
MAXX ( SUMMARIZE ( 'Query2 (2)'; 'Query2 (2)'[line brand]; 'Query2 (2)'[line design]; "_Avg"; [Q2 OS%] );
[_Avg]
)

@MarvinConceição I don't know which column you are using and how the measure is calculated. You have totally different columns in the original post and now you are using different columns, it is not very clear to me. On the original post, you have group and value columns in the table visual, and you have to use the same column in dax measure.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks for the heads-up @parry2k , That happened cause my columns in the table have been renamed to what i need to show, so this would be this:

Sum Max Average =
MAXX ( SUMMARIZE ( Table; Table(Group); Table(Value); "_Avg"; [Q2 OS%] );
[_Avg]
)
 
Table = 'Query2 (2)'
Group = [line brand]
Value = [line design]
the measure is still [Q2 OS%]
 
Sum Max Average =
MAXX ( SUMMARIZE ( 'Query2 (2)'; 'Query2 (2)'[line brand]; 'Query2 (2)'[line design]; "_Avg"; [Q2 OS%] );
[_Avg]
)
 
 
 

  

@MarvinConceição Seems like I'm missing something very obvious here and don't have full picture, The measure should work. Share pbix file with sample data, remove any sensitive information before sharing. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hey @parry2k , I was testing this again, it seems it just didn't update the measure, it is working as it should, thank you very much

@MarvinConceição ahh, great. Glad to hear. uff!!

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Okay, let me try, I'll send you the link

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.