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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I need to calculate the Share of the below table, I was able to calculate in Pbi the share per Brand by using this DAX
=DIVIDE([Sales_], CALCULATE([Sales_], ALLEXCEPT('tblProduct','tblProduct'[Brand_name])))
However subtotal needs to calculate the share base on column total (sub-total / Column Total)
In my case sub-total is returning 100%
Requirements: i write here as well the excel formula (Column F) on how to calculate the share and its sub-total.
Solved! Go to Solution.
@Anonymous , Create a measure like
if(isinscope('tblProduct'[Model]) ,
DIVIDE([Sales_], CALCULATE([Sales_], ALLEXCEPT('tblProduct','tblProduct'[Brand_name]))),
DIVIDE([Sales_], CALCULATE([Sales_], ALL()))
)
Hi @Anonymous
You can use
Share per Brand =
VAR ProductSahre =
DIVIDE (
[Sales_],
CALCULATE (
[Sales_],
ALLEXCEPT ( 'tblProduct','tblProduct'[Brand_name] )
)
)
VAR BrandShare =
DIVIDE (
[Sales_],
CALCULATE (
[Sales_],
REMOVEFILTERS ( 'tblProduct' )
)
)
VAR Result =
IF (
HASONEVALUE ( 'tblProduct'[Model] ),
ProductSahre,
BrandShare
)
RETURN
Result
This works as well, together with using dims in another table, thanks a lot!
Hi @Anonymous
You can use
Share per Brand =
VAR ProductSahre =
DIVIDE (
[Sales_],
CALCULATE (
[Sales_],
ALLEXCEPT ( 'tblProduct','tblProduct'[Brand_name] )
)
)
VAR BrandShare =
DIVIDE (
[Sales_],
CALCULATE (
[Sales_],
REMOVEFILTERS ( 'tblProduct' )
)
)
VAR Result =
IF (
HASONEVALUE ( 'tblProduct'[Model] ),
ProductSahre,
BrandShare
)
RETURN
Result
@Anonymous , Create a measure like
if(isinscope('tblProduct'[Model]) ,
DIVIDE([Sales_], CALCULATE([Sales_], ALLEXCEPT('tblProduct','tblProduct'[Brand_name]))),
DIVIDE([Sales_], CALCULATE([Sales_], ALL()))
)
It works! 🙂
I have another requirements, same table as my example but we need to add additional column at Highest level, but this comes from another table,
lets call the column as Customer_name from tblCustomer.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 8 | |
| 8 | |
| 7 |