I am looking for a way to color my data value using coding. Say for -ve value red color and +ve value green color. Is there any formatting dax function or any other way so that visually it would be easy for end user of pivot table. Note I would not like to go for conditional formatting in excel. My end user need not do any steps in excel itself. thanks
DAX functions have no way to do excel cell formatting/color. It is a requested functionality on microsoft site for DAX. thanks
Related
I have a database, where in one column I have the information about if the data was revised or not.
I then have a table that I have built using index/match, to have the data presented as desired.
However, I have tried unsuccessfully to conditionally format the data on the table, so that in case the column "Was revised?" is "Yes", it would show the value in red, as shown below.
Have you ever done anything similar? Did you use a formula in conditional formatting on VBA?
Thank you!
I will suggest converting your data into Excel Tables first. The easiest thing would be using Conditional Formatting in Excel.
However, if you convert your data into Tables, you can write a Macro to highlighted the cells red when the update column says "Yes"
I've got a bit of an oddball question, and I looked pretty hard to find an answer to no success so apologies in advance if this has already been answered.
Anyways, I have an excel spreadsheet that has every column manually set to a specific color. Now I want to alternate the hues between rows while maintaining the manually-set color. So for example, let's say column A is red and column B is blue. I would want A1 to be dark-red, B1 to be dark-blue. A2 would be light-red, B2 would be light-blue. And so on and so forth alternating until the end of the sheet.
I've thought about sampling the previous cells color and setting the next cells color based on that, but I don't know of any functions that would get me there.
I've looked at macros, and while I can sample a cell's color I cannot figure out how to set it.
I'm currently building the sheet in excel and would like to import it to google sheets when I am complete, so having the spreadsheet formulas or macros be compatible would be great. That being said, I can keep it in excel if I have to so that isn't a must.
Any help would be much appreciated!
you need to set up 4 conditional formatting rules with:
=ISODD(ROW())
=ISEVEN(ROW())
Also, I would suggest you to check this addon with which you can control colors easily just by hex code (#ffda56) https://chrome.google.com/webstore/detail/team-color
TeamColor is a Google Spreadsheet add-on for color management. Type a color code in Hex into a cell. Its background color will change to that color code. This is very useful for sharing color palette with teammates in developing apps, websites and anything else colorful.
You can do it with conditional formatting by selecting the column and then use a custom formula conditional format and enter =isodd(row()) then select your dark hue. Add another conditonal format and enter =iseven(row()) and select your lighter colour.
This method breaksdown when using a filter but you can create a column to count visible rows and then base your conditional formatting formula on that column. Bit more complicated but useful if you need to filter.
Another Sheets option is to apply Alternating colours... (under Format) but this would mean setting the two (or three if including a header of a different hue) colours separately for each column.
This is what I have created on Excel:
I am trying to publish it on Power BI. I am struggling to find a setting to color specific cells according to what I have created in Excel.
The conditional formatting guide (https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-conditional-table-formatting/) suggests coloring the cells based on the value, but I want the colors to be static regardless of the values.
Question: How can I choose to color the cells according to my specific requirement?
What you're looking for is called Column Formatting in Power BI. You can find it in the format pane in Table or Matrix visualizations.
However, the best you can do is formatting per column level (and header / total), for font color and background color. Per cell level is not available in Power BI yet. You may consider submit a feature request to Power BI if you want to.
How can I choose to color the cells according to my
specific requirement?
There is an option to develop a custom visual with this behaviour.
There's a table visual template you can use as a start.
Thank you Foxan and user5226582. I am not sure if this answer is appropriate to SO's requirement for an answer, but in the end I did a hacky way of taking a screenshot of the colour without the values from Excel and inserted it as a background image to the table on PowerBI.
For each cell you need to do the following:
extract
column name, and
value in 1st column (HI/CoF ($)) of current row,
take the last symbol from both,
convert it to number and
check resulting values in conditional formatting to determine color.
As an option, you may add both numbers and assign color according to the sum: 2 is green, 14 is red, other colors between. However, it probably wouldn't result in exactly same color matrix as is in your example.
When a pivot table is updated and the number of rows/columns is reduced (the table is contracted), how can I keep the formatting of the previously occupied cells the same as the pivot table background color. Now when the table is contracted the empty cells are blank.
i.e. When the table contracts, I want the cells that used to have data in them to be filled with a certain color.
I'm sure I could use a VBA solution for this with the "Range.Area" method but I would prefer to not use VBA.
Thanks,
Use Conditional Format.
1st select the area to set background
2nd, SetUp the Conditional Format, new rule.
then "Format Only Cells that Contains" (sorry my excel is in spanish lol),
And Select "Blanks"
Set the format you want:
and Aceept!
now you have a nice format:
and if you change options in the pivotTable the format keep looking good. and no VBA is used
hope help you, bye!
This particular question is regarding highlighting dates on a pre-made calendar.
Please see screenshot below:
I need to highlight the cell in the calendar that matches both the task and the date in the data table. For example- see L3 and P4. In the screenshot they are highlighted manually for demonstration.
Can someone please help me out with this. I've been using AND, but screwing up somewhere with the $.
If you aren't entering any data and using this as a visual tool you can spoof the spreadsheet by placing a period into the cell that matches the values you need, and then conditional format based on specific text and enter the period as the text.
This image demonstrates it as two separate tables; One with only the formula used to look for the values, and the second one formatting the background and font to be the same color (effectively hiding the period)
It its definitely a workaround and will only work if this is a visual tool.
Assuming your Data Table goes down to row 7, try entering this Conditional Formatting formula with cell B3 selected:
=COUNTIFS($AI$4:$AI$7,$B3,$AJ$4:$AJ$7,C$2)>0