Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
diegotarquino
Frequent Visitor

Please help with matrix

Hello everyone, I have the following situation:

I have a matrix with different aggregation levels, where on some of them, there´s a comment (column "First Comentario"). Thus, column "Dif explicada" has one comment associated. The issue arises when the levels are contracted (i.e. summarized) because I need to see the comment corresponding to the highest value in "Dif explicada", be it positive or negative. Please allow me to exemplify:

 

inside "Generales", all the sublevels sum up to $840, where each addend has one associated comment. What I need to show in column "First Comentario", at a consolidated level, should be the comment associated with the highest positive value that sums up to $840. In this case, $840 is the result of -600 + 308 + 1.133. In turn, -600 is the result of -387 - 113 - 100 and so on. So, inside "Generales" the highest positive value is $6.638 which has a comment associated, being that same comment the one that I need to show at the aggregated level "Generales", and similarly for the other sublevels. In other words, each sublevel should reflect the comment corresponding to its highest addend (it should work in a similar way in case of a negative "Dif explicada", showing the comment corresponding to the most negative value).

 

Example.jpg

 

I almost forgot to mention that the comment in the last row (Total) shouldn´t appear.

I´ve tried DAX and M but haven´t managed to solve this.

 

I really would appreciate any help on this.

 

Best,

 

Diego

 

1 ACCEPTED SOLUTION

8 REPLIES 8
lbendlin
Super User
Super User

It is not entirely clear what you are trying to achieve but it seems to be far outside the Power BI design envelope.

 

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
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.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Hello @lbendlin, I really appreciate you taking the time to respond.

Please find here a .pbix file as an example: Test set

Please let me know if you need further clarification.

 

Best regards,

 

Diego 

Please check the link, it asks for a login.

Hello, were you able to access the link?

lbendlin_0-1695413393638.png

 

Hi @lbendlin, I really want to thank you for your time, the solution you proposed works wonderfully!!!

Many many thanks,

 

Diego

Hello and sorry for the inconvenience. Please try again here Test set 

 

Regards,

 

Diego

Hello and sorry for the inconvenience. Please try again here Test set 

 

Regards,

 

Diego

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.