Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
msalahkar
Frequent Visitor

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 pleaseCapture.JPG

 

7 REPLIES 7
Anonymous
Not applicable

Suppose you have:
 
>> A=reshape(1:16,4,4)
 
A =
 
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
>> B=(17:20)'
 
B =
 
17
18
19
20
Then you could obtain the desired matrix C by:
 
>> C = [A(:,1:2) B A(:,3:4)]
 
C =
 
1 5 17 9 13
2 6 18 10 14
3 7 19 11 15
4 8 20 12 16
So 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".

 

amitchandak
Super User
Super User

Not sure I got it

Calculate([Net Revenue], all(Table))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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 result
Capture.JPG

 

 It 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 
 
 
 

 

Hi @msalahkar ,

 

Do you want this result? (My columns are from the same table.)

gg9.PNGgg10.PNG

 

 

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 Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

hi @v-lionel-msft 

 

Here is the table which from which I am filtering the data. The values are in other table and it is sliced by this table.

 

Capture2.JPG

 

 

Now I tried your formmula but it doesnt work. Here is how its showing now.

Capture.JPG

basically in QTR 1, i need 2,027,119 in all field of Account_subcategory_description. similarly in QTR2, I need 1,390,671 in all fileds of Account_subcategory_description. like this

 

Account_subcategory_descriptionQTR1QTR2
Gross Revenue2,027,1191,390,671
OOP2,027,1191,390,671
Car Allowance2,027,1191,390,671

 

for Allrevenue2 column i am using this measure

 

All Revenue2 = CALCULATE(SUM(General_Ledger_Entries[Correct Amount]),FILTER(Chart_of_Accounts,Chart_of_Accounts[AccountHead] = "Net Revenue"),ALL(Chart_of_Accounts[AccountHead]))
 
Thanks

Hi @msalahkar ,

 

My understanding is that you need to ignore the filters on [Account Head] column and [Account_Subcategory_Descript] column and sum by [Fiscal Quarter] column, is that right?

Try this measure again:

Measure 2 = 
CALCULATE(
    SUM(General_Ledger_Entries[Correct Amount),
    ALL(Chart_of_Accounts,Chart_of_Accounts[AccountHead],Chart_of_Accounts,Chart_of_Accounts[Account_Subcategory_Descript]),
    ALLEXCEPT(
        General_Ledger_Entries,
        General_Ledger_Entries[Fiscal Quarter]
    )
)

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi @v-lionel-msft 

 

Thanks for your effort but that is not working as well. I guess what I am asking for might not be possible at the moment in power BI.

 

Thanks for your help though!!

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors