Line and Stacked Cluster Column - powerbi

I have 2 table with in power BI. In first table "CASH FLOW TABLE", first column consist of name of jobs, second column is date, third column is cash flow of these jobs according to months. In second table "PROGRESS TABLE", first column consist of name of jobs, second column is date, third column is cumulative percentage progress of each jobs according to months. I try to use line and stacked column for these two table. For line values, I used cumulative percentage progress, for column values I used cash flow for each job. And for shared axis, I took date and job names from one of the table. I also manage relationship between two table. Then, I add filter visual to filter graph according to job names. But when I select one of the job, for example if I took date and job names from "CASH FLOW" table, when I filter job, only column values changes according to job, line also change but not goes cumulatively according to date, I can see only straight line which equals single value that is sum or average of progress of each job. Similarly, when I select one of the job, for example if I took date and job names from "PROGRESS" table, when I filter job, only line values changes according to job, column values also change but not according to date, I can see only single column values for each date. I want to see change of line cumulatively, and change of column values according to real values related with each date. Could you please help me?

Related

Using a slicer to filter a line chart in such a way that it shows a separate line for each measure and different formatting

Here is what my client wants:
A line chart filtered by a slicer. When they click on a category, they want to see a line for each distinct instance. Let's say the X-axis is the week, Y-axis is a measure called [Sales%]. This measure is a percent.
If they click on category "Country", they want a separate line for each country that appear in the dataset. If they click on "City", they want to see a separate line for each city instance.
To solve this I used field parameter, where I use the columns in the dimension tables to give me the lines for a category. It works very well.
But the last choice on the slicer is called "Sales Indicators". And let's say the company has 6 sales indicators (average for 4 weeks back sum of boolean values from the fact table - decimal values). For each sales indicator there is a separate measure.
The fact table granularity is daily, while the report is on a weekly basis.
Now when they click on "Sales Indicators" they want to see a line for each measure. This is not a category, but a group of measures and I don't know (if it's possible) how to use it in the parameter. How to make the slicer filter for these 6 measures.
And then there is the problem with the data type. Only this 6 measures (the last option of the slicer) are decimals. All other options show [Sales%] by category. How can I approach the problem?

Power BI Divide two measure from different tables and show in a graph with time

I have two tables, Table one has daily data, Table two has weekly data. I've created a start of week column in Table 1 to get weekly data. Data is as shown below :
I want to create a table where I can divide these two measures. Both measures are counts in a week. I want to present this in a line/bar chart with time at the x-axis. Right now when I use the Date of Table 1, My measure 2 takes the overall count as the date of table 2 is not present and vice versa. I was thinking of creating a new Calendar table but I'm unable to get these measure values in that table.
I tried creating a custom calendar table but I'm not getting the desired result. I'm getting correct values from table 2 but no values from table 1. I feel the problem is because table 1 has duplicate date values.
Table 1 actual data before consolidation:Measure is the count of case numbers
I think you need a slight paradigm shift in your thinking, potentially.
Rather than looking for a way to create a third table from two other tables, what you should do is create a relationship between the two tables to make a rational description of how you want these tables to work, and then write the DAX on top of it.
So, in your case, you describe one table having daily data, and the other having weekly. The intermediary calendar table would be a daily calendar, where each day (row) knows the end of week date.
You would then create a relationship from your daily table to the calendar table based on day, and create a second relationship to your weekly table based on end of week date. (assuming bi-directional filtering)
You could then create a measure:
myRatio = DIVIDE(SUM(DailyTable[value]), SUM(weeklyTable[value])
In your chart, you can then show the daily value as a fraction of the weekly value by using the 'Day' field from the calendar table, or you could show the ratio of the complete week from the daily table to the weekly total in the weekly table by using the end of week date in the chart.
If what you truly need is a 3rd table, then you could use the SUMMARIZE() function on this 3 table set to do the summarization into a 3rd table using the same principle.
myNewTable =
SUMMARIZE(calendarTable
,calendarTable[End of Week Date]
,"My Ratio" //the name of the field you want to create
,[My Ratio] //the formula to describe what goes in the field
)

Finding the earliest commit date of every Pull Request

In Power BI I have a table with the following columns (this is a simplified version of the real table):
PullRequestId | CommitId | CommitDate
I want to find the first and last date of commits made for each pull request id.
The purpose is to calculate a metric on that data (for this example the time span of the commits).
I am not sure how to achieve it (measures or columns? what is the correct DAX expression?)
If you want to get calculated table with this data to use it later, the following DAX should do it:
SUMMARIZECOLUMNS(TableName[PullRequestId], "Min Date", MIN(TableName[CommitDate]), "Max Date", MAX(TableName[CommitDate]))
If you just want to display a visual in Power BI, then the best choice would be to use Matrix visual with PullRequestId in Rows section and two CommitDate fields in Values section. Just set aggregation rule of the first one to "Earliest" and of the second one to "Latest" so you will get a table with PullRequestId and first and last commit dates. No DAX needed here.

Two different date ranges driven by a single slicer?

My data source is a list of events. There is one column with a timestamp, and other columns are attributes (type, location, severity, etc) of that event. I would like to produce a "weekly report".
Most of the charts on this report will be based on the events that occurred in the user-selected week. Example: column chart showing count of events per location. Other charts are to show the current week's counts compared to previous weeks. Example: line chart showing the total count of events in each of the last 12 weeks
I believe I can achieve this by having two separate slicers, one for selecting the dates of the current week, the other to select the comparison range, and each chart linked to the appropriate slicer. Ideally, however, the user would be able to select a single range (e.g. the week of the report) and the second set of charts would be relative to it. Is this possible?
I produced the following example using 2 slicers, both referencing the Date field, but one slicer for each chart. I want both charts controlled by a single slicer:

How to SUM DISTINCT Values in a column based on a unique date in another column of a Power BI table

I have a table in Power BI, where I have two columns like Date and Daily Targets. Daily Targets are always same on the same date so I need a measure to only SUM 1 value for 1 date instead of calculating every row because these two columns contains duplicate values. Please see at attached screenshot for the data table.
As you look into my data, there are two distinct dates and all I need is when I add this Daily Target Column in any visualization, instead of adding 11653+11653+11653 for 3rd Jan, it should only Sum 11653 for 3rd Jan. Please help me with it, I will be very grateful to you.
To get a measure that takes the maximum value of the Daily Target by date, you can do something like this:
Daily Target = SUMX(GROUPBY(Table1, Table1[Date], "Max Daily Target", MAXX(CURRENTGROUP(), [DailyTarget])), [Max Daily Target])
Assuming your table is called Table1
The inner GROUP BY says to identify the highest daily target for each date. This assumes any given date will only have a single daily target (you could equally pick the MIN or AVG as they should all result in the same number). Note, if you have a single date with 2 different daily targets, this formula will fall down because it will only pick the biggest.
The outer SUMX sums each day's biggest daily target. This is important if you are aggregating by month or year. At the end of January, you want to have up to 31 daily targets added together.
Note: In general, I would roll up the daily target by day before loading the data into Power BI. It's not fully clear from your screenshot why you have records at a lower granularity, so I can't explain how I'd do it in your particular case. However, this post by DAXPatterns.com does go into how to handle "sales vs. budget", which may be relevant to you: http://www.daxpatterns.com/handling-different-granularities/