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
pardeepd84
Helper III
Helper III

Calculate max value in row on matrix

Hi,

I am trying to get the 'max' count in a row within a matrix. My matrix contains the following fields:

 

Max count - rows and columns.JPG

 

 

I now need to create a further calculation to find the 'max' for each provider and each client within the matrix.  

 

i.e. Orange PLc (provider) has 10 employees, what I need it to count is the maximum number of times an employee visits a client. 

 

For example 

 

Orange PLC 

Employee ID - 25 - Visited client ID 1234 3 times

Employee ID 51- Visited client 3455 1 time

 

I would need to calculation to return '3' as the result for the row.  

 

Please could I have some help with creating this.

 

1 ACCEPTED SOLUTION

Hi @pardeepd84 ,

 

Based on your description, you want to display the maximum value in the matrix row.

Be aware that DAX measure are based on row context and the matrix is a multidimensional model. As a result, the context in the matrix does not exactly match the context in the two-dimensional dataset.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@pardeepd84 , Try a measure like

 

calculate(maxx(values(Table[Employee ID]), calculate(count(Table[Employee ID]))), removefilter(Table[Employee ID]))

Thank you so much

 

Máximo.JPG

@amitchandak 

 

@amitchandak I tried this but it but this does not return the result I require.

 

I'm not sure why I would use the remove filters option. Please could you advise.

Hi @pardeepd84 ,

 

Based on your description, you want to display the maximum value in the matrix row.

Be aware that DAX measure are based on row context and the matrix is a multidimensional model. As a result, the context in the matrix does not exactly match the context in the two-dimensional dataset.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

I do not understand your answer. It is not possible to calculate the minimum or maximum in a matrix for each row?Mïn.JPG

Hi @V-lianl-msft 

 

Thank you for your reply, I have used another method to calculate find this out.  

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.