Multi row dependent dropdown - if-statement

I'm currently working on adding a dependent drop down to a spreadsheet I'm working on. I've used this formula to create a working dependent drop down on one row...
=if(J9=Operators!B1,indirect("Operator"),if(J9=Operators!C1,indirect("Livery")))
....but I wish for this to be replicated in each row down to J65. I've played around with my formula to no avail and have also made use of an array/transpose formula which I found via a google search but this only creates an error message asking me to add 700 more columns

you will need arrayformula like this:
=ARRAYFORMULA(IFERROR(IF(J9:J65="Livery",
TRANSPOSE(FILTER(Operators!B2:B, Operators!B2:B<>"")), IF(J9:J65="Operator",
TRANSPOSE(FILTER(Operators!C2:C, Operators!C2:C<>"")), ))))
which will generate the items for dropdown and then you need to create a dropdown per each cell in L column
spreadsheet demo for first 3 dropdowns in L column

Related

PowerBI - Is there possible to have 2 dropdown values that are applied to the entire column?

I want to implement on PowerBI a calculator that I developed in Excel.
Basically, it works this way:
I have a list of Dates:
I have a Database that combines in a key the name of the source with a date:
I have a calculation table where I apply into a Dropdown menu value an entire column, it combines with the Source, forming a key, where I can calculate the Source variation choosing two dates (an initial and an end date).
I would like to know how can I apply it into Power Bi, specially step 3. With a Dropdown menu that is applied to an entire column "dynamically"
You can do this with Calculation Groups. To use them, you have to use the free external tool Tabular Editor.
Setting dynamic date ranges like this is a very common use for Calculation Groups.
Here's an example of a prior year Calculation Item:
CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR(cal[date]))
You can create multiple Calculation Items to define all the various periods you need.
You can then set the calculation group as the field for a dropdown menu, and each calculation item you defined will be an option in the menu.
Here's an intro article. This same website has the best training on calculation groups you can find online. (And it's all free.)

How to add multiple fields in columns of Power BI matrix and view them without drilldown

I've trying out Power BI to solve some visualization problem in my organization and I've been working on desktop version of Power BI to try out its features.
I'm stuck at few issues and cannot find our way out of this.This is a sample view I've been trying to create:
Figure 1:
1
We've a dataset containing Product Opinion across gender, Age Group, Geography etc. and we want to pivot the opinion across different parameters as shown above.But when we use Matrix view of Power BI and add two parameters in columns, it creates a drill down view as shown below:
Figure 2: 2
On adding multiple fields in the column section we get an option to move down to next hierarchy as shown below:
Figure 3:3
Although we have the option to move down to hierarchy ,we are unable to show then side by side as we've shown in Figure 1.
Is there a way we can get the visualization as given in Figure 1 ?
Also, Currently the columns and rows are automatically sorted alphabetically. Is there a way we can adjust the column and row position as per our needs?
To sort the rows in a custom order, you will have to create an index table. The below link walks you through the steps involved:
http://www.excelnaccess.com/custom-sorting-in-power-bi/
Now, to achieve the visualization you are looking for, the only way I can think of is to create two matrix visualizations (One for gender and other for age group) and place them in such a way, that it gives the illusion of the same table. There might be a better way to do this, but I these workarounds work just fine. Hope this helps.

Merge or combine two columns in power bi

I am not sure if my title is correct one, but here is the deal:
I want to make a matrix visualization in Power Bi Desktop. I have fields: ARTICLE_ID and ARTICLE_NAME.
I would like to have both those fields in COLUMNS position in matrix data view. And I need them to be in one row, no need to drill down... because it is one and the same thing...
I need to have ARTICLE_ID and ARTICLE_NAME as two separate columns on the same level. without drilling. And also, I dont want to use concatenation or merging into some third column. is that possible? thanks
1) I started with this sample data.
2) I created a matrix and configured it as shown in the image below.
3) I clicked the forked arrows to show all levels.
4) In the Rows section of the formatting pane, I turned off "Stepped layout".
5) In the Subtotals section, I turned off "Row subtotals".
I don't know if this is exactly what you are looking for, but I think it is the closest I can come up with since you don't want to concatenate the columns together.
If they are from the same table then just drag and drop them into the columns.
The way a matrix works from my understanding in PowerBI is;
Rows are just the headings/categories of the values.
You might need to also go into the format tab, values, and make sure show on rows is on.
For example, let's say our value headings are rainy days and sunny days.
Your columns are months.
The rows will be the 2 categories.
The values will be the values.
As concatenation and "&" does not work in Power BI directquery you can use the below one:
[New_column_name] = if((table_name[column_name]="A" && table_name[column_name]="B"),"AB","NA")
Thanks,
Sachin Kashyap

Conditional/cascading/dependent drop-down list

I am essentially trying to do that this guy is trying to do:
Excel drop-down list using vLookup
I've gone through the steps and since my data set has about 400 different drop down options I am hoping there is an easier way than naming ranges. I have a list of about 400 different account names. Each of these account names is tied to a household and identified by the household ID number. A household can have anywhere from 1-5 account names. I would like for my drop down menu to be able to identify a household ID number and then provide the drop down with the account names associated with it.
Example:
Where household Id number is the identifier.
I've gone here as well http://sites.madrocketscientist.com/jerrybeaucaires-excelassistant/data-validation/dynamic-indirect and am trying to find a way to save on some of the manual work.I am a total newbie so thank you in advance for any help you can provide.
Let's pretend you have three worksheets. The first worksheet, Sheet1, is the sheet that your users will be looking at and it has the drop down lists. We'll say that the cell containing the first drop down option is in B1 (the one with about 400 different options) and the cell containing the dependent drop down is in B2:
On your second sheet, which we'll call MasterList, is all of the data options and the corresponding data. Row 1 is a header row; Row 2 and down is the actual data:
On your third sheet, which we'll call DropDownLists, is where the magic happens. It first needs to have a list of all the unique data options. I've put that in column A. You can get the unique data options from your master list through whatever means you prefer (Advanced Filter, Pivot Table, formula, VBA, etc). That list of unique data options is the basis of your drop down list for Sheet1 cell B1. Then in cell B2 of DropDownLists and copied down as far as needed to guarantee it will grab all data associated with the selected Data Option, use this formula (adjust sheet names and ranges to suit your actual data):
=IF(OR(Sheet1!$B$1="",ROW(B1)>COUNTIF(MasterList!$A$2:$A$10000,Sheet1!$B$1)),"",INDEX(MasterList!$B$2:$B$10000,MATCH(1,INDEX((MasterList!$A$2:$A$10000=Sheet1!$B$1)*(COUNTIF(B$1:B1,MasterList!$B$2:$B$10000)=0),),0)))
This makes your DropDownLists sheet look like this:
Lastly, we need to make that list (data based on the selected Data Option) a dynamic named range. I named it listFilteredData and defined it with this formula:
=DropDownLists!$B$2:INDEX(DropDownLists!$B:$B,MAX(2,ROWS(DropDownLists!$B:$B)-COUNTBLANK(DropDownLists!$B:$B)))
Then for Sheet1 cell B2, use Data Validation and define the list with =listFilteredData and you will get results as shown in my example.
Practice with this.....it will get what you need.
Your data will have to sorted for this to work.
Sorted Data
Data Validation for Shows
Data Validation for Episodes
This formula in the data validation box
=OFFSET($A$1,MATCH($E$4,$A:$A,0)-1,1,COUNTIF($A:$A,$E$4),1)
Enter the array formula to find the Duration
Must be confirmed with Ctrl & Shift & Enter
=INDEX($C$4:$C$18,MATCH(1,(E4=$A$4:$A$18)*(F4=$B$4:$B$18),0))

Adding more condition to Vlookup

I want to use vlookup formula with 2 scenarios:
Example: I have sheet 1 with full data and Sheet 2 with other information. In sheet 2 I want to pull those records which exists in sheet 1 with vlookup. I have already wrote that query for vlookup. In same I want to add below conditions:
1) column c2,A2 & G2 of sheet2 are matching in any row of Sheet 1.
My vlookup formula is this:
=VLOOKUP(A2,Sheet3!$A$2:$J$20332,10,FALSE)
There are duplicate rows in column A and thats why it is not working as a primary key. Kindly share your thought.
You should be able to construct a primary key by linking together all the information which will create a singular entry.
Given the limited info you provided I would go with creating in both sheets a new column with:
=A2&C2&G2
You could then do a vlookup based on this singular value and get the information from one sheet into the other.