Forum Discussion
Adding a column with fixed value in matrix
Hi,
I am creating a P&L in matrix and along with the amount column i want to add a percentage column which divides row value with total revenue. therefore I want to calculate a measure which shows revenue on each row regardless of the column row slicer. Here is a percentage which shows percentage with account head. I want to add a percentage column as (account subcategory/net revenue). Please help
Can anyone help please
7 Replies
- amitchandakSuper User
Not sure I got it
Calculate([Net Revenue], all(Table))
- msalahkarFrequent Visitor
hi amitchandak and Anonymous
just to make my question clearer, here is what i tried
AllRevenue = SUMX(FILTER(Chart_of_Accounts,Chart_of_Accounts[AccountHead] = "Net Revenue"),SUMX(ALL(General_Ledger_Entries[Correct Amount]),General_Ledger_Entries[Correct Amount]))It gives following resultIt is accumulating all revenues for whole period and showing it same value in all quarters. What i need is that it accumulates Revenue for the quarter and displays the same in all rows in its respective quarter. I hope I am able to explain clearly and you guys can help. Thanks- v-lionel-msftCommunity Support
Hi msalahkar ,
Do you want this result? (My columns are from the same table.)
Measure 3 = CALCULATE( SUM('Sales 2015'[Value]), ALL('Sales 2015'[Brand]), //Remove filter on [Brand] column ALLEXCEPT( 'Sales 2015', 'Sales 2015'[CountryRegion], 'Sales 2015'[Month] // Group and sum by [CountryRegion] and [Month] ) )Maybe you can show an example data model composed of these two tables and the results you want, we can compare the two to see how to calculate.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicableSuppose you have:>> A=reshape(1:16,4,4)A =1 5 9 132 6 10 143 7 11 154 8 12 16>> B=(17:20)'B =17181920Then you could obtain the desired matrix C by:>> C = [A(:,1:2) B A(:,3:4)]C =1 5 17 9 132 6 18 10 143 7 19 11 154 8 20 12 16So you take the first two columns of A concatenate the column B and then concatenate the last two columns of A.You can generalize this a bit into:>> D = [A(:,1:N) B A(:,N+1:end)]Where N then stands for "insert B after the Nth column".