PowerBI Matrix- Compare cells from two or more rows and highlight if the values differ - powerbi-desktop

I need to compare values in the column in three rows within a group and highlight the group is atleast one value is different. For example:
Code Row Amount
_A
________1 100.13
________2 100.13
________3 100.24
_B
________1 200.00
________2 200.00
________3 200.00
In the above example I want to highlight all rows under "A" as the third record has a different amount than the other two. The group for B will should not be highlighted as all three amounts are same. Can this be done in PowerBI using the Matrix viz.

Related

Custom sort in excel , by each account name and then by cost

I have an excel like
I want to sort the value by the Second column but
I want to retain the "yellow" colored rows containing total values as well after each sorting group, so the expected output will be BARBIE MEDICO first then the total sum of BARBIE, then RAJESH ..
When I tried Sort Box with Name and Then BY, all cost ( yellow) rows are coming on the top
Another example

Excel formulas to track sales - count and extract functions

This is an example of a sales tracking spreadsheet that I want to create.
I want column L to count the number of sales each person does but do it so that it runs in a fill series order. I have inputted data manually in column L to demonstrate.
there are approximately 11 different types of membership. As I enter the sales information in columns B to G, I want the types of membership in column G to extract to the breakdown box in columns P to T. This is so that I can see which staff member sells what types.
I want to replicate this formula to work out how much each staff member has taken financially. this would extract from H/I to the other box in column P to T.
Answer to the first part of your question:
I want column L to count the number of sales each person does but do it so that it runs in a fill series order.
Formula for cell L1
=COUNTIF($K$1:K1;K1)
For L2 it then becomes
=COUNTIF($K$1:K2;K2)

Keep all rows whose 1st cell matches other rows' 1st cell

In a excel table (500K+ lines), I would like to keep only those rows, all of them, whose column A is 100% identical to other rows' column A. This is irrespective what's in columns B, C, etc., but the rows must be sorted in their entirety (i.e., rows not to be broken up). Rows whose column A is not 100% identical to at least one other row's column A are to be deleted.
I am looking for possible solutions other than using =COUNTIF(A:A,A1)=1.
For example, the original table:
coumnA columnB
abc 123
0xyz xxx
aaa-123 123
aaa-12 0xyz
0xyz 098
00xyz 098
0xyz x111xx
Keep all occurrences of rows with 100% identical column A:
0xyz xxx
0xyz 098
0xyz x111xx
This formula =COUNTIF(A:A,A1)=1, identifies multiples of column A and works in small sets of rows. Is there a better, more efficient way to accomplish this with row numbers that approach the excel sheet's limit (1,048,576 rows)?
An alternative to =COUNTIF(A:A,A1)=1 is to create a PivotTable with ColumnA for ROWS and Count of ColumnA for VALUES. Then lookup the A values in the PT and if their count is 1 flag them so with filtering on the flag the rows may be deleted.

Sum first five instances in Excel

I have an Excel table with three columns. Column A has a list of countries, Column B has a list of cities in each country and Column C has populations of those cities.
The way the table is structured makes it so that Column A will have repeated names of countries - as many times as the number of cities in each country, in column B.
I would like to sum the populations of the first five cities in each country.
I have tried using SUMIF and COUNTIF but haven't managed to do it. How can I sum the populations (in row C) of the first five cities appearing for each country?
Are you trying to sum the population of the first five cities in the list or the population of the top 5 most populous cities for each country (which if the list is sorted by population, these are the same)? If it's the latter you can do it with a one line array formula
=SUM(LARGE(IF(A:A="CountryName",C:C),{1,2,3,4,5}))
(Ctrl+Shift+Enter after setting up the formula)
Where you replace "CountryName" with a reference to the country you want the sum of the top 5 populations for. I think the only issue with this is it will fail if there are less than 5 cities in a country on the list.
Here is a version of the formula that works when there are less than 5 cities but still caps at out at the top 5. Getting an array of 1-n values is kind of an ugly hack in Excel but this seems to work.
=SUM(LARGE(IF(A:A="CountryName",C:C),ROW(OFFSET(A1,,,MIN(COUNTIF(A:A,"CountryName"),5)))))
(Ctrl+Shift+Enter after setting up the formula)
Add a column D. In D2 write the following formula D2=COUNTIF($A$1:$A2,$A2) and drag it down.
Now what this will do is ranking the instances of a particular country.
Now it's a very simple formula for column E, where you will get the sum
E2=SUMIFS($C$2:$C$1000,$A$2:$A$1000,$A2,$D$2:$D$1000,"<=5") and drag it down
Now for each country you will have the sum of population of first 5 cities

Excel counting pairs

I have 5000 rows. In column A I have the salesperson , in column B the buyer. I am trying to find out how many times each combination appear together. e.g. Did salesman Abe sell to Buyer Bob 33 times, to buyer Carl 19?
ok takes a few extra columns to accomplish this but here goes...screenshot attached first.
First you need to concatenate the two columns (A and B)you want to enumerate in column C (the formula will accommodate a string in case names column is first last with spaces etc.)
=$A2&" "&$B2
Then in column D use the following formula to determine whether or not the name combination is duplicated but only true for one instance. I'll explain why in a second.
=$C1<>$C2
Then in column E count the matches.
=COUNTIF($C:$C,$C2)
After doing all that, filter results by "True" tally for all the True columns is the number of matching rep/customer relationships.

Resources