How to Format Power BI Table / Matrix Regardless Of Values - powerbi

I am very new to Power BI and I have this requirement to format the table which is not conditional formatting but kind a hard coding formatting.
First Row Column 1 is Yellow, Columns 2, 3 and 4 are Red
Second Row Column 1 is Green, Column 2 and 3 are Yellow, Column 4 is Red
Third Row Column 1, 2, 3 and 4 are Green
Fourth Row No Colour
I have also attached the pic below

I guess this is not possible. The reason is, all columns are generated dynamically based on your data in the table. That's why you need to apply conditions to color cells as you want.
Now, as you showed in the sample presentation, if you have that fixed amount of rows and columns with known fixed values in different cells, you can use CARD visual for each individual value to show and then use your expected background.Not a good approach, but the end user will see the expected output :)

Related

Power BI: How to change the background color for specific rows in a matrix?

I want to change the background color for specific rows in a matrix based on the name of the row.
Here is my matrix
What I did so far was to create a conditional column X in the data table that says, for example, when asset_name is A82 give me 1, in all other cases give me 0. Then for each field in Values, I created a conditional rule based on that X column -
when column X is 1 - blue color, when is 0 - white color. Basically, I apply conditional background color for the columns. However, I want to be able to conditionally color the rows. There is no option to choose a background color for the fields in Rows. Therefore, I'm able to custom-color only the column part of the matrix.
Is there any workaround for this?
Could you use something like this - you can conditionally format a row based on the value of a measure https://www.cloudfronts.com/conditional-formatting-by-row-in-a-matrix/

Matrix Conditional formatting : why when column has 0 then its all red? Power BI

I set up Color Scale no color from lowest value to red color for highest value.
But if I filter data and column "Losses" have values $0 then for some reason the whole column becomes red.
Is any way how can it make it with "No color" if all the values are 0's?
in order to fix the problem I also have to indicate max value. So I used maximum value as $1,000,000 which is fit for my dataset.

Power BI, matrix subtotal formatting

In can I format the matrix subtotal and total rows so that they look different from the rest of rows(text format, color, size... e.t.c.)? I mean all the row not only the numbers that are by default bold, but also the text part.
Can anyone provide me with a relevant code?
enter image description here
I mean to format also column, not only the values.
You sure can, as long as you have data in the matrix visualization, you will have access to this field in the formatting options under "Subtotals":
Here, you can format colors, text size and font.

Tkinter - Columns of equal weight are NOT equal width

I have a Tkinter Toplevel window with three columns. All three columns are configured to have equal weight. Inside column 0 and 2 are sub-frames, inside which are Listbox widgets. Inside column 1 is a set of buttons. For some reason, despite the fact that my 3 columns have equal weight, these Listboxes 'force' their columns to occupy more space.
I've written,
window.columnconfigure(0,weight=1)
window.columnconfigure(1,weight=1)
window.columnconfigure(2,weight=1)
But I get:
I've also given column 1 weights of 3 and 5, but it still remains small. However, having done this, it seems that columns 0 and 2 have some minimum size, then after subtracting that from the real width, the leftover width is used and divided by weight.
Is this a bug? Is there something I need to do to my lists? Might I be forgetting something?
It is not a bug. weight determines how extra space is allocated. It doesn't make any guarantees about the size of a row or column.
If you want columns to have a uniform width, use the uniform option and make them all be part of the same uniform group.
window.columnconfigure(0,weight=1, uniform='third')
window.columnconfigure(1,weight=1, uniform='third')
window.columnconfigure(2,weight=1, uniform='third')
Note: there is nothing special about 'third' -- it can be any string as long as it's the same string for all three columns.

Caffe: Multi-Label Images with Varying Number of Labels

I have a dataset where the images have VARYING number of labels. The number of labels is between 1 and 5. There are 100 classes.
After googling, it seems like HDF5 db with slice layer can deal with multiple labels, as in the following URL.
The only problem is that it supposes a fixed number of labels. Following this, I would have to create a 1x100 matrix, where entry value is 1 for the labeled classes, and 0 for non-label classes, as in the following definition:
layers {
name: "slice0"
type: SLICE
bottom: "label"
top: "label_matrix"
slice_param {
slice_dim: 1
slice_point: 100
}
}
where each image contains a a label looking like (1,0,0,...1,...0,....,0,1) where the vector size is 100 dimension.
Now, I apologize that my question becomes somehow vague, but is this a feasible idea? I.e., is there a better approach to this problem?
I get that you have 5 types of labels that are not always present for each data point. 1 of the 5 labels is for 100-way classification. Correct so far?
I would suggest always writing all 5 labels into your HDF5 and use a special value for when the label is missing. You can then use the missing_value option to skip computing the loss for that layer for that iteration. Using it requires add loss_param{ ignore_label = Y } to the loss layer in your network prototxt definition where Y is a scalar.
The backpropagated error will only be a function of labels that are present. If input X does not have a valid value for a label, the network will still produce an estimate for that label. But it will not be penalized for it. The output is produced without any effect on how the weights are updated in that iteration. Only outputs for non-missing labels contribute to the error signal and the weight gradients.
It seems that only the Accuracy and SoftmaxWithLossLayer layers support missing_values.
Each label is a 1x5 matrix. The first entry can be for the 100-way classification (e.g. [0-99]) and entries 2:5 have scalars that reflect the values that the other labels can take. The order of the columns is the same for all entries in your dataset. A missing label is marked by a special value of your choosing. This special value has to lie outside the set of valid label values. This will depend on what those labels represent. If a label value of -1 never occurs you can use this to flag a missing label.