Powerbi Matrix issues with the value field - powerbi

I have a problem with Powerbi I can't seem to fix. If the answer is obvious i am sorry but i am just starting out with Powerbi.
We are trying to make a dashboard that will show if a coworker is available or not based on a code 1 -3).
We check their availability per ISOWeek. If they don't have work that week they get code 1, when they have work code 2 etc.
These codes show up the right way in SQL but when I want to add them in my matrix table and have the coworker names on the rows, the ISOWeek on the columns and then when i add the Code in values Powerbi wants to show the total, total(distinct), first or last.
The problem is it wont use the code it got per isoweek. Is there a solution for this?
Thanks in advance!
What is should look like in the matrix:
Fixed it by giving the columns: don't Summarize on the modeling tab. Then I gave the code column the minimum value for each week.

Related

Summary of column by month with conditions (if greater that one, only one will be considered)

I'm newbie in the PowerBI world and I want to create a matrix for the year of events reported by the users, they are required to enter only one a month however there are some users that create more than one, and only one need to be considered for the report.
I have been trying some DAX functions unsuccessfully.
Thank you in advance for any suggestion to solve my problem.

DAX function to check the amount of dates that is greater than another set of dates in 2 different columns

I'm currently doing an internship where I have been asked to make a few visuals in Power BI
I've searched around, tried a couple of things. But the truth is I am very much a beginner at coding and functions in general. Only had basic courses of different languages during my education and to be fair, it's a bit outside my scope of work.
So I have 2 columns I need to compare in order to find out how many dates in column 2 that is greater than the dates in column 1
So I'm imagining something like:
Measure = IF[(Investments(Expected closure)]<[(Investments(Actualclosure)]
Basically I want an overview of how many investments have a later closure date than expected.
Next thing would possibly be to create a boxplot showing the distribution (by how far we are off).
I know this is very basic, and possibly not formulated in the best way possible, please let me know if you need any more information.
Thanks in advance
You can use a calculated column as a flag to identify if actual date > expected date and then count the flag.
Flag = IF('Table'[Act] > 'Table'[Exp], 1, 0)
Hope this helps. Thanks.
enter image description here
Welcome to the community. Be sure to read to read this for posting questions.
For your questions, you can use the following code. You are filter the table with your logical expression with FILTER and then you count the lines of a column with COUNTA.
Measure = CALCULATE(COUNTA('Investments'[Actualclosure]),FILTER(ALL('Investments'),'Investments'[Actualclosure]>'Investments'[Expected closure]))
Hope this solves your problem.

Power BI Table w/ Slicer Where Other Columns Adjust Parameters Based Off Selection

I have the following Power BI table example for an operating expense report that uses a slicer to filter the first column named "Actual". This is to see the operating expenses for one month compared to the budget figures for the year. It also compares the year-to-date and annual figures. How can I create dynamic columns that change based on the slicer selection? These additional columns are not shown in the pic below but included in the last pic. The Budget column below was just created as an example to show what it should look like.
I set up a star schema with several tables shown below. There's only one expense fact table used and the slicer only works for the first column as previously stated but I need all the other columns to use different parameters and adjust based off what's selected in the slicer. The last image is an overview of the info and the parameters for each column. I tried creating new columns with measures for the budget to see if I can get that going but can't figure out how to make it adjust with the slicer selection.
I'm not sure if I should be using separate queries for each column or can this be done using the one expense table. Hope this isn't too confusing. Please let me know if more info is needed.
If I understood what you wanted correctly I think I solved your problem.
I was able to create the following:
I did not use all values since I did not want to type everything, if you provide some test data it is easier to replicate you dashboard.
This matrix (so not table) allows you to filter for Date (if you so desire, you can always show all date's in the matrix) Book and AccountTree.
The way this is done is by putting the address column in the ROWS for the matrix, Putting the Date column in the COLUMNS of the matrix and putting your values (actual, budget, variance) in the values of the matrix.
For the date is used days, since it was easier to type. You can always use weeks, months, quarters or years.
For this to work you have to create the following relationships:
Hope this helps.
If not, please provide test data so it is easier to try and solve your problem.

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