PowerBI - Cumulative diagram with changing values - powerbi

I am attempting to create a cumulative graph much like this one:
I have the following table in PowerBI
BugHistory
BugID
Date (date)
DateTo (date)
EntityStateName (text)
Effort (number)
I would like to do a measure that would tell me the amount of summed Effort on any given date for each EntityState.
I have tried quite a few things, even adding a Date Table using the Calendar, but getting the values to be shown correctly on a StackedGraph seems to be beyond me.
Hope someone can help.

Follow the following steps:
Right click on the column "Effort" and click the option called "New quick measure" in the right click menu.
In the window that appears, choose "Running Total" under the Calculation drop-down
This will show 3 new fields
In the Base Value field, drag and drop the "Effort" column
In the Field column drag and drop the "Date" column.
In the direction column choose Ascending
This will create a new measure in your Table. You can use that measure in you chart.
You can refer to the following video for reference: https://youtu.be/KlXclbN4oWE?t=497

Related

Inventory database with calculated incremental values from movements by date

I am tring to recreate an inventory database in which, by COD_ART, there is the stock value by date.
I have the data shown in picture A. The "inventory column" rapresent today inventory value while the "Movement" column rapresent the increased/deacreased value by date.
I would like to have a new column with the incremental quantity:
14/10/2021 | 925
13/10/2021 | 933
30/09/2021 | 733
etc.
Can anyone help me?
Thank you in advance for any suggestion.
What you're looking for is called "Running Total" and its better to create a Measure than to create a Column, because technically speaking if you have multiple rows for same date, then running total in a column gets tricky. Also learning measures will be a really good skill under your belt.
And PowerBI has simplified creating this measure by adding the Quick Measure feature.
You can check out this video starting at 6:41 to get an understanding of how this works.
Steps:
Right-Click on stock-value column and select "New Quick measure"
In Calculation drop-down, select "Running Total"
If you right-clicked on the stock-value column, PowerBI will automatically add that column to "Base Value" field
Drag the date field into the "Field" section
Choose Ascending - which is selected by default.
Click Ok
Now the measure will be added to your table and you can create a table using this measure.

Dynamic column change in visual based on slicer in power BI

I have a chart as below,
Here I have certain metrics which needs to be shown as Monthly, quarterly, yearly.
Ex. if monthly is selcted chart should show in months as mentioned,
if quarterly is selected chart should show in quarter and same applies for yearly.
So I tried with following code,
Created a table,
|Monthly|1|
|Quarterly|2|
|Yearly|3|
Created the selcted value measure as
select = selectedvalue('table1'[column2])
Created a switch to use that calculated column in axis of the bar chart,
switch[select]
1,'calendar[Month]',
2,'calendar[Quarter]',
3,'calendar[year]')
Output is showing as variant data-type cannot be used in calcualted column,
I understand that some values are either text or number, how to change accordingly to same datatype.
I have tried with zero also it is showing the same error.
Is there any other approach to this dynamic changing of columns?
You can add buttons and use bookmarks to assign action based on Month, Quarter and Year to those buttons, all you need to do is create 3 visuals and align them then based on buttons make the visual visible/invisible and the update the bookmark.

Summation of rows based on Dropdown selection in Power BI

I have a dropdown in Power BI that contains different project name such as Project One, Two, Three. I have included one formula to bring forecast value which is:
Forecast = Chase * Target%
I have created one measure that calculates forecast. The dataset contains weekly based data for Chase and Target %. For example week 1 (Jan 01-Jan 08) Chase will be 30 and target % as 10 hence the forecast for Week 1 is 3 (30*10%)
When I select one project from dropdown list e.g. "Project One" I see the forecast value populating correctly. Same goes if I select only one project from dropdown list .
The issue arises when I select multiple projects and then the forecast value brings the maximum value instead of bringing summation to the values of all weeks of all projects.
Question: What exactly is causing the issue?
Now I understand your requirement from your comments. You can achieve this through 2 step as explained below-
Step-1: Create a custom column in your data source as below-
row_level_forecast = finetarget[chase]/100.00 * finetarget[target]
Step-2: Create the final Measure as below-
forecast = sum(finetarget[row_level_forecast])
Now, use measure "forecast" in the report. This should give you the desired output.
ISSUE-2: From your comments
If I understand correct, you are talking about a case where you are concern about values in columns I marked red in the below picture-
If I am correct with my understanding, you wants to fill week-3 values for Project-1 with 80/70 and for Project-2 100/90. If this is ok, just follow these following steps.
Step-1: Go to EDIT mode clicking "Transform Data" option and select the table you wants to adjust data.
Step-2: Sort your data first for project_name (ascending) then week (ascending). The output will be also as shown in the above image.
Step-3: Select column "chase" in the table and click Fill>>Down option.
Step-4: Repeat step 3 for column"target" as well.
The final output should be as below. Just move back to main report by clicking "Close and Apply". Data should be now as expected in your report.
When you display the forecast, put it in a grid and add the project column, the week column (e.g. Week 1) and the forecast measure. When you select your multiple projects the grid will show each of those along with the calculated measure. If this does not work, there is something wrong with your measure and you should add your measure calculation script to your question.
The measure should be simple, something like:
Forecast = SUM(YourTable[Chase]) * AVERAGE(YourTable[Target%])

Dax measure to remove the date filter and provide the all resultant column

I have a scenario where I have a date filter on the page, for one of my widget, I want all the column data without considering d filter.
I tried using All(C1), but when I drag the dax to report, gives me error , expecting single value but getting multiple
Click on your slicer (Month in your picture), then go to Format > Edit Interactionand then click on None(grey circle)
on your table. This way the table ignores the filter which comes form the specific slicer. With the grey circle you can basically turn off/on the interaction (ignore slicer or not).

Power BI: Make a Table Visualization display all observations of a dataset

I've noticed that If you have a table in the Data Viewer in Power BI desktop such as this:
Then, if you insert the same table in a Table Visualization, the table will only display distinct values of the categories:
How can you set up a Table Visualization so that the data is displayed as it is in the Data Viewer where all observations are displayed?
Unfortunately, Power Bi Desktop currently does not have an option to display all observations in the Table Visualization(Oct 2018). I am optimistic the Power Bi team will correct this problem in a future release. If you feel strongly about this feature, please go to the Power Bi improvement Idea post and add your vote.
I'm answering this question to perhaps help others who come here looking for a work around until it gets implemented.
There is currently one work around that I know of: Add an index column to the data table, add this column to your table visualization, then shrink the column width of the index to hide the data. This is not a desirable work around, but might get you a solution in a pinch until the feature is implemented.
So for your example, to add an index column to your table, go to Edit Queries -> Add Column -> Index Column -> From 1
Then - back to your report, add the Index column to the Table Visualization and make sure you select Don't Summarize for the Index Column values tab pull down.
Once the index column is added to your table, and you sort by the index your table visualization should look like the following:
The last step is to hide the index column by shrinking the column width of the index column. Before you do this, you need to turn off word wrap for the columns and the values. Go to the paint roller and in Column Header and Values make sure you turn word wrap off:
then your final table will look like the following with all of the values required. The grey box is my mouse over the shrunk index column and wont show up for you unless you mouse over that area: