Using O365
In F2, find sum for Type "Revenue" and Group "A" using the Amount & Allocation % Tables.
F2 = $10,000 * 10 % + $15,000 * 20% = $4,000
10% = ACCT + A
20% = BRRT + A
I'm trying to avoid adding helper columns to the Amount Table such as:
Using =XLOOKUP(Table1[#[Dept]:[Dept]]&Table1[[#Headers],[A]],Table2[[Dept]:[Dept]]&Table2[[Group]:[Group]],Table2[[Alloc%]:[Alloc%]],0)*Table1[#[Amount]:[Amount]]
So far, I am stumped about how to proceed without the use of Helper Columns and a SUMIFS in J2. This method would use too many resources given my dataset size (200k rows).
Any ideas? SUMPRODUCT with SUMIFS? Power BI table links and DAX? TIA
you are on the right tract with SUMPRODUCT and SUMIFS:
=SUMPRODUCT(SUMIFS(Table1[[Amount]:[Amount]],Table1[[Type]:[Type]],Table4[#[Type]:[Type]],Table1[[Dept]:[Dept]],Table2[[Dept]:[Dept]])*Table2[[Alloc %]:[Alloc %]]*(Table2[[Group]:[Group]]=Table4[[#Headers],[A]]))
Table1 = A1:C5
Table2 = A7:15
Table4 = E1:I3
Related
I have two tables, Products and Ingredients. I want to take a the weighted average of all Products with the same Code.
Here is the Ingredient Table
And Here is the Product table where I am using a formula to calculate Avg Price.
Here is a formula that I used but I have no idea how to change it to only calculate the averages for items with the same code. I thought about AVERAGEIFS but not sure how to implement it into the formula.
=B2 * SUMPRODUCT(Ingredient!D1:D6, Ingredient!C1:C6)/SUM(Ingredient!C1:C6)
You could do:
= B2 * SUM( Ingredient!$C$2:$C$6 * Ingredient!$D$2:$D$6 * (Ingredient!$B$2:$B$6=C2) )
/ SUM( Ingredient!$C$2:$C$6 * (Ingredient!$B$2:$B$6=C2) )
I have a table with 4 columns. Variable1, Variable2, Kpi1 and Kpi2.
Variable1 is one level above Varible2 (i.e, variable1 is the parent of variable2).
Kpi1 is an integer and Kpi2 is a float [ range (0,1) ].
When making a pivot table, variable2 looks fine with its values, but the column total (variable1) doesn't. Kpi2 can't be calculated as a simple sum or a simple average of its values of variable2. It needs to be a weighted average of it using kpi1.
To make it more clear I will leave here an example I did on Excel.
Is there any form I can achieve this?
You will need to add a helper column & a calculated field to pivot table to do this.
New Table Column = Product = kp1 * kp2
Calculated Field = Weight = Product / kp1
You can add or remove fields from the pivot table once completed
I am working on a matrix in Power BI and I am not figuring out how to sum each column recursively until the total:
And this should be the resulting matrix (as an example, rows):
Some clarifications:
The months (columns) are dynamically generated based on the transaction month. I could filter the data to get the same data for only three months.
"Nombre proveedor" stands for "Vendor name".
I don't care about "Total" row.
These are my values:
So, I think I should create a measure with DAX to replace "Accounting Balance" to sum the previous column (month) or show nothing (to avoid zeroes).
Searching on internet I found several sites to get the running totals by rows, but not by columns.
Any suggestions?
Try Something like this:
Maesure =
CALCULATE (
[Accounting Balance],
FILTER (
ALL ( 'table' ),
'table'[Transaction month] <= MAX ( 'table'[Transaction month] )
)
)
I can rank my data with this formula, which groups by Year, Trust and ID, and ranks the Areas.
rankx(
filter(Table,
[Year]=earlier([Year])&&[Trust]=earlier([Trust])&&[ID]=earlier([ID])),
[Area], ,1,Dense)
This works fine - unless you have data where the same Area appears more than once in the same group, whereupon it gives all rows the rank of 1. Is there any way to force unique rank values? So two rows that have the same Area would be given the rank of 1 and 2 (in an arbitrary order)? Thank you for your time.
Assuming you don't have duplicate rows in your table, you can add another column as a tie-breaker in your expression.
Suppose your table has an additional column, [Name], that is distinct between your multiple [Area] rows. Then you could write your formula like this:
= RANKX(
FILTER(Table,
[Year] = EARLIER([Year]) &&
[Trust] = EARLIER([Trust]) &&
[ID] = EARLIER([ID])),
[Area] & [Name], , 1, Dense)
You can append as many columns as you need to get the tie-breaking done.
I need to Aggregate a number of multiplications which are based on the Row and Columns context. My best attempt at describing this is in pseudo-code.
For each cell in the Pivot table
SUM
Foreach ORU
Percent= Look up the multiplier for that ORU associated with the Column
SUMofValue = Add all of the Values associated with that Column/Row combination
Multiply Percent * SUMofValue
I tried a number of ways over the last few days and looked at loads of examples but am missing something.
Specifically, What won't work is:
CALCULATE(SUM(ORUBUMGR[Percent]), ORUMAP)*CALCULATE(SUM(Charges[Value]), ORUMAP)
because you're doing a sum of all the Percentages instead of the sum of the Percentages which are only associated with MGR (i.e., the column context)
Link to XLS
One way of doing that is by using nested SUMX. Add this measure to ORUBUMGR:
ValuexPercent :=
SUMX (
ORUBUMGR,
[PERCENT]
* (
SUMX (
FILTER ( CHARGES, CHARGES[ORU] = ORUBUMGR[ORU] ),
[Value]
)
)
)
For each row in ORUBUMGR you will multiply percent by ....
the sum of value for each row in Charges where ORUBUMGR ORU is the same as Charges ORU. Then you sum that product.