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
joaquinel
Helper I
Helper I

Matrix. Wrong results in columns when use description in place of key field

Hi,

 

I have a Matrix that I want to divide by a label. My problem is that only works when I use the key field. When I change de key by its description my Matrix shows me the total result in each column.

 

Thanks

1 ACCEPTED SOLUTION
joaquinel
Helper I
Helper I

It was my mistake, I was writing the formula in a wrong way. The problem was the FILTER(ALLEXCEPT). The correct way it's to write de Attribute Table which field you want to use it. 

 

I was using the Facts Table field. I have changed it ContratosServicio[IdCentro]  by Centros[Id] and now it works.

 

CALCULATE(COUNT(ContratosServicio[Id]),
filter(
     ALLEXCEPT(ContratosServicio,Centros[Id],ServiciosContratables[IdTipoServicio] ), ContratosServicio[FechaAlta] < MIN(calendario[date]) && ContratosServicio[FechaBaja] = BLANK())

View solution in original post

5 REPLIES 5
joaquinel
Helper I
Helper I

It was my mistake, I was writing the formula in a wrong way. The problem was the FILTER(ALLEXCEPT). The correct way it's to write de Attribute Table which field you want to use it. 

 

I was using the Facts Table field. I have changed it ContratosServicio[IdCentro]  by Centros[Id] and now it works.

 

CALCULATE(COUNT(ContratosServicio[Id]),
filter(
     ALLEXCEPT(ContratosServicio,Centros[Id],ServiciosContratables[IdTipoServicio] ), ContratosServicio[FechaAlta] < MIN(calendario[date]) && ContratosServicio[FechaBaja] = BLANK())
Anonymous
Not applicable

Hi @joaquinel ,

How did you set your matrix visual? What's the expected result when you put the decription field to replace key field? Could you please provide some sample data(include key field, description field and values fields etc.) with Text format and your expected result with backend scenario and specific examples? It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Please exclude the sensitive info before you share any info with us. Thank you.

How to upload PBI in Community

yingyinr_0-1667886194276.png

Best Regards

he facts table is ContratosServicio and is linked with Centros by IdCentroContratacion and Id

 

joaquinel_2-1667897109435.jpeg

 

When I use the IdCentrodeContratacion the data is correct (see below matrix1) but I need to use de Id from Centros table because I need the Description, but the result is not correct since shows me the whole totals in each column (matrix2 below)

 

joaquinel_3-1667897109437.jpeg

 

 

 

 

 

 

Thanks

Anonymous
Not applicable

Hi @joaquinel ,

Please try to set the cross filter direction option of the relationship between the table 'ContratosServicio' and 'Centros' as Both, and check if you can get the correct result.

yingyinr_0-1668063073001.pngSet cross filter direction as BothSet cross filter direction as Both

If the above one is not working, please provide the matrix visual Fields setting and its formula if the value field refer any measure or calculated column. Thank you.

Fields settingFields setting

Best Regards

daXtreme
Solution Sage
Solution Sage

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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