I'm aware that NPV and IRR are possible in Spotfire 7.7 using TERR Agg functions.
I have a data file with cash-flows and associated dates. I need to be able to select sub-sets of that data set and calculate a live NPV / IRR result.
Does anyone have a work-around to do this in 7.6?
We have time series data with cashflow as well. I calculate a new column that discounts every value and then sums and aggregates those as needed for the NPV calculation.
Simple calc column :
[Cashflow ($M)] / (1.1 ^ (Year([Date]) - 2018))
We discount at a 10% rate.
My understanding is that you need to use TERR for IRR. A good post on it is here:
https://community.tibco.com/questions/i-am-new-spotfire-and-am-trying-setup-dynamic-irr-calculation-given-cashflows-i-want-be
Related
together
somehow my pivot table is currently crashing. The table is structured as follows:
Area, Code and QTY1 are defined by the data model. QTY2, Min and Performance are measures.
QTY2 sums all codes for defined filters from another table. Min calculates the lower value of QTY1 and QTY2.
Measure Performance calculates the ratio of Min to QTY1.
Unfortunately, the sum of Min from Excel will be incorrect. Also, the mean or the sum of performance is also wrong.
Formumlar QTY2: =CALCULATE(SUM(tbl2[QTY]);FILTER(tbl2; tbl2[TYP]<>"11"))
Formular MIN: =MIN([QTY2];[QTY1])
Formular Performance : = [MIN]/[QTY1]
What exactly am I doing wrong?
How can the mistake be avoided?
Edit:
The following approach sums up the right volume for [Min].
But it is not showing the accurate average of 37%. It sums up the divided value.
[Performance]=SUMX(tbl_General;DIVIDE([QTY2];[QTY1];BLANK()))
[Min]=SUMX(tbl_General;(MIN([Qty1];[Qty2])))
Why is that so?
Best regards
Joshua
So this is an example of where SUMX is needed.
You've stumbled on the difference between the aggregation of an expression and the sum of values.
Something like SUMX(dim_Tbl, DIVIDE([MIN], [QTY1], BLANK())) should work
EDIT:
After seeing the edit on the OP, the following measures should work.
Min = SUMX(tbl_General;(MIN([Qty1];[Qty2])))
and
Performance = DIVIDE([QTY2];[Min];BLANK())
In general, 'X' measures are used to iterate over a table and sum the table whereas 'normal' measures are used for recalculations in sums. Your Performance measure you want to recalculate for the total, so don't use SUMX, your Min Measure, you want as a sum of the previous values, so do use a SUMX.
I'm moving from an old Excel based reporting system to PowerBI and I'm finding some discrepancies.
When I take the same listed percentages in PowerBI and calculate the average in excel, it's different (See Below):
I have no idea what's going on here... I thought maybe it was a rounding issue, but it's just not making sense to me.
When I export the PowerBI data from the table and then average it in excel it's a different number.
That shouldn't happen, right?
Am I going crazy here?
When I calculate it manually I get 99.828% which should round to 99.83% as Excel shows.
It seems to me that the PowerBI average is simply incorrect.
Edit:
After applying RADO's answer, here are my results (I dropped the Round and it seems to work - I think maybe it's an issue with my data - not his methodology):
There is a critical difference between how Excel and DAX calculate averages.
Excel takes average of the rounded numbers in each row.
DAX (Power BI) calculates averages independently in each cell. Meaning that cell "total" is calculated not as average of rounded scores, but as average of non-rounded underlying values of the entire data set, which is then rounded. This is how DAX operates conceptually - each calculation is always done independently of other calculations in the table.
The way to fix it:
In Power BI, rewrite you DAX formula to use AVERAGEX instead of AVERAGE. For example:
Correctly Averaged Scores =
AVERAGEX(
VALUES(TableName[Submitter]),
ROUND(CALCULATE(AVERAGE(TableName[OrbScore])),2)
)
Here, we first create a list of distinct "Submitters". Then we iterate over the list, and for each submitter calculate its average and round it to 2 digits. Finally, we calculate the average of the rounded averages, essentially replicating the behaviour of Excel.
I am completely new at excel and I have an assignment involving 12k of rows. Basically, I have to calculate the average of the all the values from the same date. These dates follow the arithmetic succession with a difference of 7. Therefore, dates will be like 2/2/52; 2/9/52; 2/16/52; 2/23/53 etc. I know how to find the average of a specific group of values, but selecting one group of values at a time to find the average will take forever because there must be about 5k of different dates. Therefore, I was looking for an automated way that allows me to find the average without going to select the values every single time. The following is an example of the spreadsheet that I am dealing with:
DATE------------------VALUE
2/2/52----------------3.5
2/2/52----------------3.4
2/2/52----------------2.5
2/9/52----------------4.5
2/9/52----------------3.6
2/16/52---------------2.4
2/16/52---------------4.1
2/16/52---------------3.1
2/16/52---------------4.2
2/16/52---------------2.34
Also, please note that the dates do not change in a pattern, meaning dates do not change every n rows.
This is a perfect candidate for a PIVOT table.
Here is your data.
DATE VALUE
2/2/1952 3.5
2/2/1952 3.4
2/2/1952 2.5
2/9/1952 4.5
2/9/1952 3.6
2/16/1952 2.4
2/16/1952 4.1
2/16/1952 3.1
2/16/1952 4.2
2/16/1952 2.34
Select the data and insert pivot table.
Drag Date into rows
Drag VALUE into VALUES
Drop down on the values - select value settings
and select Average
Row Labels Average of VALUE
2/2/1952 3.133333333
2/9/1952 4.05
2/16/1952 3.228
Grand Total 3.364
I'm trying to get the average number of "on time shipment" based on items rolled up to "ship numbers" and then by "order number". I have one order number in this scenario that is shipped via multiple shipments. It seems to me that after rolling it up via PowerPivot and then creating a pivot table, it's calculating the average based on the total lines of the "order number" instead the pivot.
PowerPivot Data:
Pivot based on data above:
How can I get the average number based on the pivot table rather than the PowerPivot total data of the order number? I'm probably not making any sense, but hopefully the images below explain it better. As you can see, when you roll up the items by ship number then by order number, you'll see that the actual average is 0.6 but the pivot is showing 0.5.
Help!
Technically speaking, the average is correct - if you look at the source data, for some reason all rows are duplicated and if you do regular average calculation, it's actually 0.5.
What you are looking for is calculating average for distinct values, which can be done easily with AVERAGEX function.
I have copied your table and created those 2 Calculated Fields (in Excel 2010, it's Measures):
Average on Time:
=AVERAGE(Table1[On Time])
Average on Time (UNIQUE)
=AVERAGEX(VALUES(Table1[Ship Number]), [Average on Time])
Using AverageX with VALUES() function makes it easier to calculate any expression ONLY for unique values.
If you then put both measures on PivotTable, you should get this:
First column is same as yours (using "regular" AVERAGE function). The second one shows the average calculated over distinct (unique) values of Ship Numbers.
Hope this helps.
PS: This great article by Kasper de Jonge helped me quite a bit with similar scenarios.
I have created a power pivot table as shown in the picture. I want to calculate quarter over quarter sales change. For which I have to divide for example corporate family "Acer" 's sales in 2012Q4 by sum of all the corporate family. I am using calculated measure to do this, but I am not sure what formula I can use.
My need is to create two columns, one for 2012Q4 percent of total and one for 2013Q1 percent of total. Then I will create another measure to find the difference. So the formula for 2012Q4 should be like this 1624442 / (1624442+22449+1200+16123) . Any idea which function can help me do it?
It sounds like you are measuring the change in the percent of total for each corporate family from quarter to quarter. You will need to create 3 calculated measures. I'm not sure what your model looks like so I can't give you the exact formula, but here is the idea.
CurrentQtr%ofTotal:= Divide(Sum('Sales'[Units]),Calculate(Sum('Sales'[Units]), All['Product'[Corporate Family])))
PrevQtr%ofTotal:= DIVIDE(CALCULATE(Sum('Sales'[Units]), DATEADD(DimDate[DateKey], -1, QUARTER)),
CALCULATE(Sum('Sales'[Units]), DATEADD(DimDate[DateKey], -1, QUARTER), All('Product'[Corporate Family]))))
Change%ofTotal:= DIVIDE(([CurrentQtr%ofTotal]-[PrevQtr%ofTotal]),[PrevQtr%ofTotal])
I used the divide function because it handles divide by zero errors. You use the ALL function to remove the filter on the Corporate Family column from the filter context. The Change%ofTotal is just to find the differenc. I'm calculating % change but you may just want to subtract.
Here's the link to a good blog post on time intelligence. And here's one on calculating percent of total.
For percentages please follow the tutorial on the Tech on the Net.
Adding another column where you calculate a difference between two pivot columns will not work - this column is "unpivotable", as it relies on a column defintion. You would need to copy and paste pivot as values to another worksheet and do the extra calculation there.