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
Gabe_Moreira
Frequent Visitor

Matrix displays repeated values in every column

Hi everyone, need your help on this again!!!

 

I have a matrix that only displays values if the filter "Fase de Entrega" is selected.

 

Gabe_Moreira_0-1676297485956.png

Gabe_Moreira_1-1676297771365.png

 

Values columns:
"Anterior" = Previous values; font = d_EAP(BL3);
"Atual" = Actual values; font =   d_EAP(BL2);

"Original" = Original value, won't be changed ever = d_EAP(BL1).

Note that they're all from the same table, but different columns.

 

Gabe_Moreira_1-1676298921045.png

 


Furthermore, I've got two measures for the icons that I Want to appear on the matrix columns, one for the Actual ["Atual" on green] value and another for the Previous ["Anterior" on red] value. Booth return an image based on the "Fase de Entrega" filter, and have the following code structure (where the letters (a, b, c) are changed by the image url on the real code):

 

 

 

Icon_Imp_Atual = 
var filtro = SELECTEDVALUE('d_EAP_Códigos_Fases'[Fase])
return
IF(ISFILTERED('d_EAP_Códigos_Fases'[Fase]),
    SWITCH(
        TRUE(),
        filtro =  "Engª Conceitual / Básica","a",
        filtro = "Aprovação da HA","b",
        filtro = "Engª Detalhada","c",
        filtro = "Planejamento (Aquisições e Contratações)","d",
        filtro = "Execução Início","e",
        filtro = "Execução Término","f"),"")

 

 

 

 

Then I use this DAX as the code that will change the icon of my cell elements' values.

Gabe_Moreira_0-1676298595115.png

 



The thing is that everytime that I have a value for the "Actual" or "Previous" columns, the icon with both coulors is displayed at both column. But I want that's only the Previous or Actual column contains the proper icon.

I hope you could understand my issue and help me with it!
Best Regards!

1 ACCEPTED SOLUTION

Hi everyone,

 

So, I end up finding the solution by myself (and a little help from Chat GPT lol).

 

I've decided to use only one data-set column on Value field, this column gathers all dates for every  case (Original, Previous, and Actual).

Then I've decided that the "Previous" info wasn't necessery for our report. With that decision made, i've writen the following dax:

 

Icon_Imp_Atual_BL2 =
var filtro = SELECTEDVALUE('d_EAP_Códigos_Fases'[Fase])

return
IF(
    MAX(d_EAP[BaselineNumber]) = 2,
    SWITCH(
        TRUE(),
        filtro =  "Engª Conceitual / Básica",[Icon_Imp_Engª Conceitual / Básica],
        filtro = "Aprovação da HA",[Icon_Imp_Aprovação da HA],
        filtro = "Engª Detalhada",[Icon_Imp_Engª Detalhada],
        filtro = "Planejamento (Aquisições e Contratações)",[Icon_Imp_Planejamento (Aquisições e Contratações)],
        filtro = "Execução Início",[Icon_Imp_Execução Início],
        filtro = "Execução Término",[Icon_Imp_Execução Término]),
    [Icon_Início])
 
Those measures are images urls, that will return the icons on the matrix.
 
At the end, i've just used thar measure as a Cell Element Icon function and there we've got the result:
Gabe_Moreira_0-1676479776887.png

 


View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @Gabe_Moreira ,

 

Struggling in getting how your setup is puicking up the actual vs previous.

 

Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi Miguel,

Thanks for trying to understand my issue.

I'm sending you the file via private message

 

Summing all up, this matrix has 3 columns (Original date, Previous date, and Actual date), and rather than returning these dates on the matrix, I want to display icons that are calculated by an switch dax code, triggered by the "Fase de Entrega" Filter. These icons have different colours, the original is a system default Star, the Previous should display red icons, as the Actual are green.

 

The main trouble is, for exemple,if I have these dates:

Original (01/01/23);
Previous (01/02/23);
Actual (01/03/23)
the matrix is displaying the icons like that:

01/01/2301/01/2301/01/2301/02/2301/02/2301/02/2301/03/2301/03/2301/03/23
OriginalPreviousActualOriginalPreviousActualOriginalPreviousActual
🔴💚🔴💚🔴💚

 

but the way it supposed to:

01/01/2301/01/2301/01/2301/02/2301/02/2301/02/2301/03/2301/03/2301/03/23
OriginalPreviousActualOriginalPreviousActualOriginalPreviousActual
   🔴   💚

Hi everyone,

 

So, I end up finding the solution by myself (and a little help from Chat GPT lol).

 

I've decided to use only one data-set column on Value field, this column gathers all dates for every  case (Original, Previous, and Actual).

Then I've decided that the "Previous" info wasn't necessery for our report. With that decision made, i've writen the following dax:

 

Icon_Imp_Atual_BL2 =
var filtro = SELECTEDVALUE('d_EAP_Códigos_Fases'[Fase])

return
IF(
    MAX(d_EAP[BaselineNumber]) = 2,
    SWITCH(
        TRUE(),
        filtro =  "Engª Conceitual / Básica",[Icon_Imp_Engª Conceitual / Básica],
        filtro = "Aprovação da HA",[Icon_Imp_Aprovação da HA],
        filtro = "Engª Detalhada",[Icon_Imp_Engª Detalhada],
        filtro = "Planejamento (Aquisições e Contratações)",[Icon_Imp_Planejamento (Aquisições e Contratações)],
        filtro = "Execução Início",[Icon_Imp_Execução Início],
        filtro = "Execução Término",[Icon_Imp_Execução Término]),
    [Icon_Início])
 
Those measures are images urls, that will return the icons on the matrix.
 
At the end, i've just used thar measure as a Cell Element Icon function and there we've got the result:
Gabe_Moreira_0-1676479776887.png

 


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.