Power BI: Create a total column from unrelated data set - powerbi

I have two HR data sets below; one is data of all employees by department and categories (total population) and the second is the data set of employees that left and their leave reason (departure data).
There is less data in the departure data set and the employee IDs are not always matching it wouldn't make sense to join.
My desired result is the last table below. The blue part is a summary of the departure data. I can do the blue part of the table in PowerBI but I cannot add the yellow and red part (summary of total employees and leave rate by department and categories). When I try it just put 16 in all rows. Is there a way to do this in PowerBI?
Note: These are hypothetical examples, and my data sets have more rows.
Thanks.
desired result

This is known as an asymmetric matrix and it would be too long to post the full instructions here. You can read a good summary at the following link for how to achieve this: https://exceleratorbi.com.au/building-a-matrix-with-asymmetrical-columns-and-rows-in-power-bi/

Related

Add customizable date range comparisons to a Power BI Table

I am trying to recreate a Tableau table view in Power BI where I can compare two customizable date ranges and show the percent differences across metrics as a calculated row.
Reference Screenshot from Tableau
In practice, my table will have 3 rows: 1 row for each time period selected and a row for the percent difference. The percent difference row is a nice to have, not a need. All my table metrics are coming from the same source.
I also need to set up two different date slicers that each row of my table will reference. I've played around a little with setting up a separate date table for the comparison period to be selected from, following this thread: Comparing Data Across Date Ranges
The challenge now is showing two separate periods in the same table.
Appreciate any guidance!

PowerBi- Prevent slicer from filtering a table returned measure

I will do my best to explain this correctly. I have a data set that has 4 category columns (Date, Store, Provider, Pick Location) and 4 value columns (Total Orders, Total Deliveries, Accepted Deliveries, Assigned Deliveries). Please see the image here:
The two total columns should be grouped by date and store and have the same value regardless of the provider or pick location - There is the potential to see the same value up to 4 times depending on the category combination. The final two value columns will be different for every line and should not be grouped.
The issue I am facing is to be able to:
Sum up the total columns by the date/store group to ensure there is no duplication
Sum up the other value columns NOT by the date/store group without affecting the totals
Have the total columns be only affected by the Date and Store slicer (NOT the Provider and Location)
Have the other values filter as normal for all slicers
Ultimately calculate percentages of "total" based on the affected slicers.
Here is a visual summary of what I would be trying to accomplish:
Currently, I have been able to create a "sum of averages" to allow the total values to display correctly based on the date and store, but am unable to get it to ignore the provider and location slicer:
total_pro_orders_f = var _table=SUMMARIZE(md_pbi_datafile,md_pbi_datafile[date], md_pbi_datafile[store_number],"_orders", averagex(md_pbi_datafile, md_pbi_datafile[total_pro_orders]))
RETURN
calculate(SUMX(_table,[_orders]), REMOVEFILTERS(md_pbi_datafile[lpName],md_pbi_datafile[transaction_is_sourced]))
I have tried all the different ignore filter commands I could find but no matter what I do I cannot get the totals to stay the same regardless of provider or location.
Does anyone have any advice on how to accomplish this?
Thank you all!

How to get multiple category lines with bar chart in Power Bi?

Sample Data.
CompanyA,2019-01-01,29000
CompanyA,2019-02-01,35000
CompanyA,2019-03-01,43000
CompanyA,2019-04-01,27000
CompanyA,2019-05-01,45000
CompanyA,2019-06-01,21000
CompanyA,2019-07-01,26000
CompanyA,2019-08-01,27285
CompanyA,2019-09-01,26035
CompanyA,2019-10-01,24785
Expected Output.
My Boss has asked me to show sale trend by companies and month. but he wants it to be shown like below.
X axis should have Month Names
Bar lines should tell overall sales amount by month.
multiple lines should represent company sales amount.
i have achived this output by replacing 2 charts on each other (hidden one background). 
First i have taken a CLUSTERED COLUMN CHART and place a Line chart on it with hidden background.
Sample File
But for me this is just an adhoc solution and One more problem is that both chart's y axis doesn't match.
seeking for a good solution on this. either another good chart to represent this kind of data or how to achive it any other way?
Thanks in advance.
You can create measures for individual company, if number of companies is not a big number, and then put them in "Line values" to achieve the same result as above.
So For ex, if you have 5 companies in the data then create 5 different measures like below
CompanyA = calculate(sum(sales), filter(tbl, [company] = "CompanyA"))
like the above ex create measures for other 4 companies also

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.

Power Bi Desktop - How to add values between tables?

I'm trying to create a column that has a total of values between 3 columns from 3 tables. How would I go about doing this?
The 2 tables are tables of values that share an id, and they are both linked to a table of account by Id. The goal is to add up 3 columns, and place it into a table grouped by the Id.
I've attempted summing them, trying to use the USERELATIONSHIP function, and creating a relationship between them. It seems to give very inaccurate results, as if it's summing all of the totals together, and passing them to each Id. That, or it won't let me use the column, as if it never existed.
EDIT: General Idea of what I'm trying to do (Lines should be pointing to Account's Id column, but I messed up the lines)
EDIT 2: I also forgot to illustrate or mention. There are more columns with information in each table that can't be summarized for each account preventing me from just merging the table together.
Make sure your data model looks like this (change names as you please, but the structure must be the same):
In dimensional modeling, your table "Account" is a Dimension, and both fee tables are Fact tables. The operation of combining data from multiple fact tables that share the same dimension is called "drill-across", and it's a standard functionality of Power BI.
To combine fees from these tables, you just need to use measures, not columns. This article explains the difference:
Calculated Columns and Measures in DAX
First, create 2 measures for the fees:
Fee1 Amount = SUM(Fee_1[Amount])
Fee2 Amount = SUM(Fee_2[Amount])
Then, create a third measure to combine them:
Total Fee Amount = [Fee1 Amount] + [Fee2 Amount]
Create matrix visual, and place Account_ID from the Account table on the rows. Then drop all these measures into the matrix values area, like this:
Result:
Of course, you don't have to have all these measure in the matrix, I just showed them for your convenience, to validate the results. If you remove them, the last measure still works: