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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Add new row measure in Matrix

Hi! I'd like to insert a row in my matrix to get the WS % with the following computation: Wholesaler/(Wholesaler+Retailer). Any idea how?

 

amld99_0-1633965706690.png

 

1 ACCEPTED SOLUTION
goncalogeraldes
Super User
Super User

Hello there @Anonymous ! You can add the row with a measure. Like so:

WS% = 
var _whole = 
CALCULATE( 
SUM( Table[Column_to_sum]), 
FILTER( Table, Table[Dsitributor] = "Retailer")
)
var _retail = 
CALCULATE( 
SUM( Table[Column_to_sum] ), 
FILTER( Table, Table[Dsitributor] = "Retailer")
)
var _denom = _whole + _retail

CALCULATE(
DIVIDE( _whole, _denom, 0)
)

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

View solution in original post

3 REPLIES 3
goncalogeraldes
Super User
Super User

Hello there @Anonymous ! You can add the row with a measure. Like so:

WS% = 
var _whole = 
CALCULATE( 
SUM( Table[Column_to_sum]), 
FILTER( Table, Table[Dsitributor] = "Retailer")
)
var _retail = 
CALCULATE( 
SUM( Table[Column_to_sum] ), 
FILTER( Table, Table[Dsitributor] = "Retailer")
)
var _denom = _whole + _retail

CALCULATE(
DIVIDE( _whole, _denom, 0)
)

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

Hello Goncalo,

 

I wanted to achieve something a bit different with my % calc. Instead of adding retail and wholesaler in the denom, I am trying to have the calc be retailer/wholesaler. I am trying to put the above code as a new measure but I'm getting an error in the last (third) "CALCULATE" part. A way I got around the error was to get rid of the "var" parts and just use first two "CALCULATE" sections inside the "DIVIDE". my issue is that once I add this measure to the Values section of the matrix, I get two columns: One for the WS %, and the other for the current values. Is there a way to have the WS% show in its own row, in the bottom of the matrix?

Anonymous
Not applicable

This worked, thank you! 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.