i hope someone can help me.
I have several files (10 at least) connected by YEAR (just as number, not date) and CASE, and for each file I have a cash flow (i upload pbix sample file with 3 files only to simplify things)
So i Have Flow A, Flow B, Flow C, by year (not as date type) and not always Flow A has a value in a year corresponding for Flow B or C as can be seen on visuals
I created a measure for Total Flow and that works perfect.
But now, i need to calculate net present value for TOTAL FLOW and i was thinking in creating a Calculated Column with sum of Flow A, B and C, and then use XNPV...... but i get a total result for all rows in my column, I have my tables with relation to table with year and case, so i don't understand why can i just sum up 3 columns, by rows. It looks simple on excel, but not efficient if i chose that way
Creating a measure for XNPV it's not working, i get constan error (4 arguments)
I don't want to create a new excel file for getting NPV because it's to slow and i already did it and my dataset it's constantly changing (adding more CASES)
Any orientation ? How can i get in Power Bi, Net present value for Total FLow?
Thank you in advance
PBIX Sample
Related
I'm trying to refine a report dashboard utilized at my workplace. The process that I'm trying to automate is;
Data is generated into a worksheet via a query table (Worksheet called Imported Data)
From that table, i'm wanting to look at 3 separate columns for 3 conditions
Those conditions are a) Team, B) Frequency, C) Month and D) Yes (from a ye/no option)
Providing all those conditions are met Eg, Team A, Monthly, February, Yes, I want Excel to produce a response of Compliant, otherwise say Non-compliant, onto another worksheet called Governance Complaince
The response for this is on a separate work sheet.
The main query table that is generated has around 8 Team choices, 6 Frequency options, with 12 month and then the 2 (obviously) yes/no options.
I've tried a few different formulas to get this to work, but I only ever get the True value from the formula.
I Feel that maybe the formula is stopping once it sees the first Team A selection (Which by nature of how the query table is generated, is the first result in the Team column) and then ignoring the remainder of the formula, despite my best attempts.
The current formula I'm using is
=IF(COUNTIFS('Imported Data'!A:A,"Team A")+COUNTIFS('Imported Data'!C:C,"Monthly")+COUNTIFS('Imported Data'!F:F,"February")+COUNTIFS('Imported Data'!I:I,"Yes")>1,"Compliant","Non-compliant")
I've tried
=IF(COUNTIFS('Imported Data'!A:A,"Team A")+COUNTIFS('Imported Data'!C:C,"Monthly")+COUNTIFS('Imported Data'!F:F,"February")+COUNTIFS('Imported Data'!I:I,"Yes")=ROWS('Imported Data'!A1:Z500),"Compliant","Non-compliant")
=IF(AND('Imported Data'!A:A,"Team A")+AND('Imported Data'!C:C,"Monthly")+AND('Imported Data'!F:F,"February")+AND('Imported Data'!I:I,"Yes"),"Compliant","Non-compliant")
=IF(AND('Imported Data'!A:A,"Team A")+AND('Imported Data'!C:C,"Monthly")+AND('Imported Data'!F:F,"February")+AND('Imported Data'!I:I,"Yes")=ROWS('Imported Data'!A1:Z500),"Compliant","Non-compliant")
All I get is a #Value error, or only the Compliant value, despite any changes made to the data the formula references.
All the cells are text, there is no numerical data in the tables. The formula is placed into a cell in another worksheet called Governance Compliance
Essentially I want the formula to be able to look at the query table data, output the Ture/False value into a monthly tracker (This formula will be replicated over about 26 different audits for 8 teams) automatically, cutting down on manual processing. I've been able to get the date to then look at a quarterly array of teams and return a complaint/non-complaint result into another worksheet fine using
=IF(COUNTIF('Governance Compliance'!E11:G19,"Compliant")=ROWS('Governance Compliance'!E11:G19),"Yes","No")
And I thought that my 3 condition if statement to get the compliant result into the Governance Compliance worksheet would just be an expansion of conditions on this formula, but I am clearly wrong.
The query table is sorted alphabetically by Team if that makes a difference.
I'm using a calculated column that is an average. The problem is, the average is above the range of possible values, which should be impossible. I made a calculated column that calculates the average star rating (out of a range of 1-5) and the value on a visual is coming up as 6, which shouldn't be possible, even if all the values were 5 stars, which it isn't. So there must be an outlier causing the average to be above the range of possible values, but it isn't in the original data source which Power BI pulls from. The original data source shows me a value of 4.1 as an average, which is within the expected range. But Power BI's dataset has introduced an outlier or (data is missing) that caused the average to become a 6.
I can elaborate on the dax below, but what I want to try to do is pull the dataset down from power bi to figure out why it's calculating its average that way. Looking at the source data, the average is 4.1 and there are no outliers in the source data. So, it's not the source data that's the problem. Basically, I want to find the outlier that's causing the average rating to differ in Power BI.
Avg Rating = IF(SUM(data[Total Reviews]) = 0, BLANK(), SUM(data[Monthly Stars])/SUM(data[Total Reviews]))
Here's a screencap that shows the two
relevant columns
Notice that I had to manually calculate (aka eyeball the columns and type into a calculator then calculate manually) these two columns, which came out to ~4.6. I'm trying to download this dataset to explore it in further detail without having to eyeball the dataset, as the source doesn't show this discrepancy.
To get to the data you have a number of options.
Create a new report in Power BI Desktop, and then use the connect to PBI Dataset option to access that data, in for example, a table. You can create your own report based on the dataset in the service as well.
Access that data via Analyze in Excel, which should allow you to access the data in a pivot table using Excel
Use the Export data from the visual option, using this you can download 30,000 rows into a csv, or 150,000 in to xlsx formats
Please note, that these options may not be available to you if you do not have the right permissions in the workspace, or options have been turned off in the Power BI Admin tenancy settings.
I am having a hard time figuring out how to calculate what I need in Power BI. The data I am looking at involves the length of stay in various programs. Some people transfer between programs and others do not. The way the transfer data is stored, I was able to extract it in the following format from SQL. The first 4 columns are from one table which is linked to a table with transfer data (last 3 columns). See below for sample data going in to Power BI.
I need to calculate the length of stay for each person in each program, taking into account the transfer data. See below for the desired output.
If the person does not have a transfer, then the length of stay is (end date) - (start date). If the end date is null, then it is calculated based on the last day of the month (in this example, 7/31/2020).
If there are transfer/s, we need to calculate the length of stay in each program.
For person 234, they were in Program A from 5/15/2020 to 6/1/2020 when they transferred to B. Person 234 was in Program B from 6/1/2020 (transfer date from A to B) until 6/15/2020 (transfer date B to C). Then Person 234 was in Program C 6/15/2020 until 7/1/2020 (end date).
Please let me know if you have any ideas of how to get this calculation. I can use Power BI which will be my output, or I could edit the SQL query. Thank you for your help; I hope this post is clear enough!
I have a "strange" problem in visualizing the values of the "last" year (that is the most current year with data of a full year). In the example delivered it is 2019 which holds the bookings facts. The year should be derived by a related table (LetztesVollesJahrDim) that holds a min/max date and year value for each company/entity. The DateDim table holds all dates and is configured to be the Date dimension.
The relations are shown in the graphic below.
I created a Report that should display different matrix tables with different values:
one, that shows the last full year's monthly values by Cost Center (which works correct)
one, that shows all years monthly values including an estimated value for the current year (2020) (which also works correct)
one, that could drill down to the details level of the Facts and display the figures per month (in columns) of the last full year (i.e. 2019) putting the Cost Center and other groups down the most detailed level into rows. This Matrix makes use of Calculated Measures created with Tabular Editor.
At this point I can here you say... try it without the Calculated measures and indeed I did that by simply displaying a Card that got a Visual Filter to DateDim[M]=7 to simulate the appliance of each matrix's column. Problem is the same: The Month filter of the Visual (or within the Calculated Measure) is ignored and the yearly sum is displayed (~48k) which is wrong.
As I am currently an Expert in SQL Server DBMS but not in the Architecture of Power BI's DAX Models I am not truely aware about the consequences when and why filters are removed, ignored, overwritten or added at which level of modeling.
Originally I tried to create a simple Calculated Measure that reflects the last full year of the company. That works, but its usage in the huge Matrix was impossible as it was calculating forever. That's why I created the simple table "LetztesVollesJahrDim" to hold a persisted value for each company.
The idea is simple: Create a Query that inner joins these tables and display the Sum for each month [M] like this:
Fact[Turnover] - Fact[CompanyKey] -> CompanyDim[CompanyKey] <-> LastFullYear[CompanyKey] - LastFullYear[MostCurrentYear] -> DateDim[Y] - DateDim[DateKey] -> Fact[StapleDateKey]
So, what is the Problem?
I tried a couple of DAX queries and all come up with a different wrong value.
Following three different approaches for a Calculated Measure "Sum LY":
1.
Σ LY = CALCULATE(SUM(KontobuchungenFact[UmsatzNegiert]), DATESBETWEEN(DateDim[DateKey], DATE(2019, 1, 1), DATE(2019, 12,31)))
2.
Σ LY = CALCULATE(SUM(KontobuchungenFact[UmsatzNegiert]), SAMEPERIODLASTYEAR(DateDim[DateKey]))
[
3.
Σ LY = CALCULATE(SUM(KontobuchungenFact[UmsatzNegiert]), KEEPFILTERS(DateDim[M]), USERELATIONSHIP(DateDim[J], LetztesVollesJahrDim[AktuellstesJahr]), USERELATIONSHIP(DateDim[DateKey], KontobuchungenFact[StapelDateKey]))
Filters being applied on the page/visual:
CompanyKey
DateKey >= 2018-01-01 (page filter that limits the displayed rows in yearly matrix to the last 3 ys)
Some other irrelevant keys
Visual configuration:
Relations:
Values/Rows in the LetztesVollesJahrDim table:
Calculated Measures/Table in Tabular Editor showing the calculation of the "01 Jan" column of the first Matrix, which displays correct results:
Impression of the Report:
So in summary I need a clue/DAX formula that recognizes the Monthes in each column and ideally uses the relations to the last year table trespassing the year's filter through DateDim to the Facts.
It is funny, that the upper matrix works, but not the one on the bottom. It is not possible to use the calculated measures approach of the first matrix in the last matrix because the performance would drop to > minutes calculation. So I cannot use the same approach and need a fast one.
Anybody an idea? :-)
I am looking to calculate
'supplier = (sum of group 1 x weighting) + (sum of group 2 x weighting).
In excel I use 2 tables to calculate, but struggling to figure this out in powerbi so far
I am currently using PowerBi to create Averages of scores per supplier.
I am now trying to moved towards weighted totals and weighted averages.
In my scenario I have
8 Divisions
22 Groups (of suppliers ie. Joint Ventures, multiple Suppliers working on a contract)
8 Individual Suppliers made up of a percentage of a group of suppliers.
Within Excel, I have created a supplier list 1-8 which uses a sum if from another table.
SUMIFS('Group Totals (Per)'!F:F,'Group Totals (Per)'!$B:$B,$B2)
This other table is a sumif of group name, division multiplied by weighting (percentage of the contract)
=SUM(SUMIFS(Payments!$I:$I,Payments!$C:$C,'Group Totals'!$A7,Payments!$B:$B,'Group Totals'!F$1)*$C7)
My hope is to replicate this within power BI.
So I can click select a supplier and see the total payments received (which will be a sum of a percentage of the group contract (joint ventures).
However I have been unable to separate out the suppliers totals with weighting, after creating links tables.
I have supplied sample data in excel and power BI and screenshots.
Here's a link! to the files.
SUMX is similar to SUMIF in Excel. But I would recommend you using CALCULATE function which gives you lot of options. A simple google will give you a lot of tutorials on how to use it.