Multiple if and vlookup conditions - if-statement

Hope you can help me.
So I have a situation here wherein I need to use 2 different data as a basis but I don't know how.
Please see attached picture.
The All Data tab is where all of the information is location
The two other tabs are per individual.
What I need is I want to get the AHT from All Data tab and put it in Mel's tab AHT column with a specific date.
Like for example, in 9/1/2022, I want to get Mel's AHT from All data tab.[Screenshot from Google Sheet]

if AHT column in all 3 sheets is C column and headers are in row 1...
=VLOOKUP(B2; FILTER('All Data'!B:C; 'All Data'!A:A="Mel"); 2; 0)
and Nori sheet:
=VLOOKUP(B2; FILTER('All Data'!B:C; 'All Data'!A:A="Nori"); 2; 0)

Related

POWER BI visualizations - multiple columns with different status

I have one report that contain multiple columns (Status 1 to status 7) with different status (Okay, Not Okay, Completed and Not completed), each columns has different count with different status.
Example; Status 1 has two different status which is "Okay" and "Not Okay", "Okay" count has 6039 and "Not okay" count has 13.
I summarised the data of each status for your reference. (Data prepared manually)
At the moment I am using 7 different charts, is there any way I can achieve my result all of them in one chart? Can you please suggested the best way to achieve the result in Power BI visualizations?
Herewith attached the excel file for your additional reference.
https://www.dropbox.com/s/6cmuh32sit97rr1/POWER%20BI-VISUAL.xlsx?dl=0
nice to see you tagged me in LinkedIn referring this question link for my input. I am really glad for that.
I go thorough your requirement and my felling this below approach will be better (my feeling) for presentation for the data you wants present to the end user.
Now, if you are agree with me, one transformation in Power Query Editor and a single Measure will serve your purpose. Go to Power Query Editor and apply Unpivot Other Colum by selecting ITEM column as shown below-
The output will be as below-
Now get back to report and create this below Measure-
status_count = COUNT(DATA[ITEM])
Finally add a Matrix and configure as below-
Final output is shown in the first image.

How to dynamically change column source of a card to another one in Power BI

For a report in Power BI I have two column with name 'A' and 'B'. I want to show summation of values of column 'A' or 'B' in one card based on the selection of the user.
I Want to know can I change column source of a card in report view in Power BI. A simple solution is to have two cards, each one for each column. But I want one card such that the user defines source column of it.
Thanks
First you have to see if you have any data that helps you to identify if column A or B is selected.
If you havn't you can create an auxiliar table as I did to this solution like this:
Use this column to create a filter visualization
Then create the following DAX measure:
SUM = IF( SELECTEDVALUE( AuxTable[Auxiliar] ) = "A", SUM('Table'[A]), SUM('Table'[B] ) )
Don't forget to change the select options on your filter visualization to only be able to select 1 option if is necessary.
Hope it helps you.
Another possible solution without using DAX is to take advantage of Buttons and Bookmarks.
In your scenario, you could create a Button corresponding to the possible use choices. When the user click on one button it will direct to the bookmark showing the visualization calculated using that data source.
In practice, this means you will have two Cards in your report, but only one visible at a time.

Grouping by multiple columns and aggregating all values

I am rather new to Power Bi and I have a question i can't find the answer to.
I want to import a table that have some label columns, with repeated items, and more than 15 data columns.
My desire result would be to group the label columns, so no repeated items, and aggregate the values of the remaining columns.
Is there a way to do that in PQ editor or DAX ?
I appreciate any help or direction you can give me!
A sample of the table (it's much bigger, with multiple values in the first three columns)
Table Sample
Thanks a lot
Edit: From that sample, the output y I want is the following
Output Sample
The thing is, there are many different values in the first columns, and i need to agreggate all the other values, keeping they column name (cause this info is already linked to other files).
Maybe the only way is to group by and add the columns, renaming them one by one?
I want to do this in a couple of files, so if you know of another way please let me know!
In your query designer import your table. Then go to Home > Group By and group like you want it, the same goes for the aggregations and thats it.
If you just want to remove row duplicates, just group all columns which you dont want to aggregate and the rest can be aggregated like you want it.

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

aggregating data in power bi query editor

I have gone through this tutorial
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-tutorial-analyzing-sales-data-from-excel-and-an-odata-feed/
and was having some issues at Task 4 - Step 1 that I have somewhat resolved but would like to find a better way to complete the task.
The issue of this is that the title of my graph is Sum of UnitsInStock by ProductName but I just want it to be "UnitsInStock by ProductName".
See image below:
Sum of UnitsInStock by ProductName
I think the issue is that in the tutorial link it has the "UnitsInStock" column is aggregated already (which you can see in the field pane) whereas I had to aggregate the data myself. I think to fix this I just have to aggregate the data in the query editor but I haven't been able to figure out how to do this.
If someone could point me in the right direction that would be great!
The button you want is Group By - it's on the Home ribbon in the central Transform section.
Select your grouping columns before hitting it, to preload them in the Group By window. I haven't followed that tutorial so you will need to decide what to select. Any column you don't select for Group By or aggregate (see below) will be removed by this Step.
In the bottom section of the Group By window, click the + button to add an aggregation, then choose Sum and choose your column (e.g. UnitsInStock ). You have to type the output column name.