Forum Discussion
Color to Pivot Table Row
- 4 years ago
You can create a formatting measure like this.
Formatting = IF ( RIGHT ( SELECTEDVALUE ( Tabla1[Empresa Pais] ), 5 ) = "China", 1)Then apply a conditional format to the values when the measure = 1
No, I don't know of a way to apply the color to the row headers.
- 4 years ago
The only way I can think to do that would be to add a ranking measure that ranks all the '- China' rows then all the rest of the rows. The problem is then you have to add the ranking measure to the matrix and collapse all the Rank columns so you can use it to sort but hide it in the result.
I have attached my updated copy of your file for you to look at.
Rank = VAR _ChinaRows = COUNTROWS ( CALCULATETABLE ( DISTINCT ( Tabla1[Empresa Pais] ), RIGHT ( Tabla1[Empresa Pais], 5 ) = "China", ALLSELECTED ( Tabla1[Empresa Pais] ) ) ) VAR _ChinaRow = RIGHT ( SELECTEDVALUE ( Tabla1[Empresa Pais] ), 5 ) = "China" RETURN IF ( HASONEVALUE ( Tabla1[Fecha] ), BLANK (), IF ( _ChinaRow, RANKX ( FILTER ( ALL ( Tabla1[Empresa Pais] ), RIGHT ( Tabla1[Empresa Pais], 5 ) = "China" ), CALCULATE ( SUM ( Tabla1[Venta] ), REMOVEFILTERS ( Tabla1[Fecha] ) ) ), RANKX ( ALL ( Tabla1[Empresa Pais] ), CALCULATE ( SUM ( Tabla1[Venta] ), REMOVEFILTERS ( Tabla1[Fecha] ) ) ) + _ChinaRows ) ) - 4 years ago
Thank you very much for the prompt and accurate response.
Best regards
The only way I can think to do that would be to add a ranking measure that ranks all the '- China' rows then all the rest of the rows. The problem is then you have to add the ranking measure to the matrix and collapse all the Rank columns so you can use it to sort but hide it in the result.
I have attached my updated copy of your file for you to look at.
Rank =
VAR _ChinaRows =
COUNTROWS (
CALCULATETABLE (
DISTINCT ( Tabla1[Empresa Pais] ),
RIGHT ( Tabla1[Empresa Pais], 5 ) = "China",
ALLSELECTED ( Tabla1[Empresa Pais] )
)
)
VAR _ChinaRow =
RIGHT ( SELECTEDVALUE ( Tabla1[Empresa Pais] ), 5 ) = "China"
RETURN
IF (
HASONEVALUE ( Tabla1[Fecha] ),
BLANK (),
IF (
_ChinaRow,
RANKX (
FILTER (
ALL ( Tabla1[Empresa Pais] ),
RIGHT ( Tabla1[Empresa Pais], 5 ) = "China"
),
CALCULATE ( SUM ( Tabla1[Venta] ), REMOVEFILTERS ( Tabla1[Fecha] ) )
),
RANKX (
ALL ( Tabla1[Empresa Pais] ),
CALCULATE ( SUM ( Tabla1[Venta] ), REMOVEFILTERS ( Tabla1[Fecha] ) )
) + _ChinaRows
)
)
- Syndicate_Admin4 years agoAdministrator
Thank you very much for the prompt and accurate response.
Best regards
- Syndicate_Admin4 years agoAdministrator
Thank you very much for the prompt and accurate response.
Best regards