Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How to Compare 2 Values

My dataset is set up as follows:

  • identifier
  • timeframe
  • metrics

The indentifier shows up multiple times in the table because there are multiple timeframes (i.e. 1 Week Ago, 2 Weeks Ago, etc.). This table is used to track changes in my metrics. For example, using this table we can see that last week there were 8 stores closed in zone 1, 2 weeks ago there were 10 stores closed, etc. 

I would like to buy a table/visual that will allow me to track the trends. Ideally, it would look like this:

I would like to utilize icons to idicate whether the metric has increased, decreased or remained the same from last week. 

The issue I am running into is that when I use Rules in the conditional formatting section, it will only allow me to make the comparison to a summarization of the data:

But when I change it from Field Value to rules, it does not allow me to select the column I want to compare it to. 

Can anyone make some suggestions about how to do this?

 

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous 

    You can use UNICHAR() function to realize it insteading of using incons in conditional conditional formatting.

    e.g you can create three measure:

    STOREUPPER = var a=MAXX(FILTER(ALLSELECTED('Table'),'Table'[Zone ID]=MAX([Zone ID])&&LEFT([Relative Week Description],1)+0=LEFT(MAX([Relative Week Description]),1)-1),[Store ])
    return SWITCH(TRUE(),MAX([Store ])>a,UNICHAR(129049),MAX([Store ])<a,UNICHAR(129051),UNICHAR(129050))
    
    ECLOUPPER = var a=MAXX(FILTER(ALLSELECTED('Table'),'Table'[Zone ID]=MAX([Zone ID])&&LEFT([Relative Week Description],1)+0=LEFT(MAX([Relative Week Description]),1)-1),[ECLO])
    return SWITCH(TRUE(),MAX([ECLO])>a,UNICHAR(129049),MAX([ECLO])<a,UNICHAR(129051),UNICHAR(129050))
    
    STOREUPPER = var a=MAXX(FILTER(ALLSELECTED('Table'),'Table'[Zone ID]=MAX([Zone ID])&&LEFT([Relative Week Description],1)+0=LEFT(MAX([Relative Week Description]),1)-1),[Store ])
    return SWITCH(TRUE(),MAX([Store ])>a,UNICHAR(129049),MAX([Store ])<a,UNICHAR(129051),UNICHAR(129050))

    and put them to table

     

    You can refer to the following link to know more about the function:

    DAX UNICHAR function in Power BI | Datapeaker

    The following link is the related code of the icon:

    Huge List of Unicode Character Symbols (vertex42.com)

     

    Best Regards!

    Yolo Zhu

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

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    You can use UNICHAR() function to realize it insteading of using incons in conditional conditional formatting.

    e.g you can create three measure:

    STOREUPPER = var a=MAXX(FILTER(ALLSELECTED('Table'),'Table'[Zone ID]=MAX([Zone ID])&&LEFT([Relative Week Description],1)+0=LEFT(MAX([Relative Week Description]),1)-1),[Store ])
    return SWITCH(TRUE(),MAX([Store ])>a,UNICHAR(129049),MAX([Store ])<a,UNICHAR(129051),UNICHAR(129050))
    
    ECLOUPPER = var a=MAXX(FILTER(ALLSELECTED('Table'),'Table'[Zone ID]=MAX([Zone ID])&&LEFT([Relative Week Description],1)+0=LEFT(MAX([Relative Week Description]),1)-1),[ECLO])
    return SWITCH(TRUE(),MAX([ECLO])>a,UNICHAR(129049),MAX([ECLO])<a,UNICHAR(129051),UNICHAR(129050))
    
    STOREUPPER = var a=MAXX(FILTER(ALLSELECTED('Table'),'Table'[Zone ID]=MAX([Zone ID])&&LEFT([Relative Week Description],1)+0=LEFT(MAX([Relative Week Description]),1)-1),[Store ])
    return SWITCH(TRUE(),MAX([Store ])>a,UNICHAR(129049),MAX([Store ])<a,UNICHAR(129051),UNICHAR(129050))

    and put them to table

     

    You can refer to the following link to know more about the function:

    DAX UNICHAR function in Power BI | Datapeaker

    The following link is the related code of the icon:

    Huge List of Unicode Character Symbols (vertex42.com)

     

    Best Regards!

    Yolo Zhu

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