Forum Discussion

paulpena7807's avatar
paulpena7807
Frequent Visitor
3 years ago
Solved

Formato Condicional Columna

Hola a tod@s,

 

Tengo una columna con unos valores quiero formatear la columna, representada en un simbolo circular en rojo cuando el valor actual supere el valor  de la fila anterior y en caso contrario sea representada en un circulo verde, para el caso que el valor sea igual al anterior esta se represente en un circulo de color amarillo.

 

La tabla se llama registro_csp_mtto y la columna se llama kW.h

 

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi paulpena7807 ,

     

    Please create a new measure.

    Measure = 
    VAR _yellow_circle = UNICHAR(128993)
    VAR _green_circle = UNICHAR(128994)
    VAR _red_circle = UNICHAR(128308)
    VAR _cur_kmh = SUM('registro_csp_mtto'[kW.h])
    VAR _cur_fecha = MAX('registro_csp_mtto'[Fecha])
    VAR _pre_fecha = CALCULATE(MAX('registro_csp_mtto'[Fecha]),FILTER(ALLSELECTED('registro_csp_mtto'),'registro_csp_mtto'[Fecha]<_cur_fecha))
    VAR _pre_kmh = CALCULATE(SUM('registro_csp_mtto'[kW.h]),FILTER(ALLSELECTED('registro_csp_mtto'),'registro_csp_mtto'[Fecha]=_pre_fecha))
    VAR _result = 
    SWITCH(TRUE(),ISBLANK(_pre_kmh),BLANK(),_cur_kmh>_pre_kmh,_red_circle,_cur_kmh<_pre_kmh,_green_circle,_cur_kmh=_pre_kmh,_yellow_circle)
    RETURN
    _result

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi paulpena7807 ,

     

    Please create a new measure.

    Measure = 
    VAR _yellow_circle = UNICHAR(128993)
    VAR _green_circle = UNICHAR(128994)
    VAR _red_circle = UNICHAR(128308)
    VAR _cur_kmh = SUM('registro_csp_mtto'[kW.h])
    VAR _cur_fecha = MAX('registro_csp_mtto'[Fecha])
    VAR _pre_fecha = CALCULATE(MAX('registro_csp_mtto'[Fecha]),FILTER(ALLSELECTED('registro_csp_mtto'),'registro_csp_mtto'[Fecha]<_cur_fecha))
    VAR _pre_kmh = CALCULATE(SUM('registro_csp_mtto'[kW.h]),FILTER(ALLSELECTED('registro_csp_mtto'),'registro_csp_mtto'[Fecha]=_pre_fecha))
    VAR _result = 
    SWITCH(TRUE(),ISBLANK(_pre_kmh),BLANK(),_cur_kmh>_pre_kmh,_red_circle,_cur_kmh<_pre_kmh,_green_circle,_cur_kmh=_pre_kmh,_yellow_circle)
    RETURN
    _result

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum