Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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?
Solved! Go to Solution.
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 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?
This worked, thank you!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
18 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
25 | |
10 | |
10 | |
9 | |
7 |