Forum Discussion
Changing color using DAX and conditional formatting in Excel
Hello, I need your help to solve this problem:
I have a workbook whose source is a tabular cube, I would like to be able to write a dax function from the cube which would allow the values to be conditionally formatted (Red, green or nothing at all) when the data is consulted from Excel.
PS: users connect to the cube and view the data independently as they wish, so I can't use the conditional formatting which is in Excel. This would have to be done from the cube and Excel would just have to display the values with the corresponding background colours.
I tried the switch like this :
= SWITCH(
TRUE(),
'vente'[EstLigne] = TRUE(), "#228B22",
'vente'[EstLigne] = FALSE(), "#ff0000",
"#000000"
)
mais il me renvoie les couleurs sous forme texte.
Thank you in advance
2 Replies
- AnonymousNot applicable
Hi Anonymous ,
Can you provide more information about the modeling associated with tabular cube?
Adamk Kong,
Best regards
- AnonymousNot applicable
Hi Adam,
it's a classic tabular cube with 2 fact tables and associated analysis axes.
I'll take a simple example:
I have a sales tabular cube with 2 analysis axes (Product and Customer) and a fact table. What I want is to display the data from the fact table FtSales with a green background for sales where the invoice is >= €5000, red if the invoice <= €5000 and white for the rest.
I would like to do this from the cube so that once it is displayed in an Excel workbook the formatting is applied when these columns are displayed in the TCD by the end users.Thanks in advance.