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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Pedro14
Regular Visitor

DAX calculate market share (% value) of the category per vendor

Hi,

I would like to calculate the market share (% value) of the category per vendor.

As per below, what is the % value of the total spend per color per vendor?

Any help would be appreciated.

 

Her is the data table:

Vendor NameColorSpend$
xBlue10
yBlue30
zBlue20
yRed40
xRed20
zRed50
Total 170

 

 

ColorSpend$
Blue60
Red110
Total170

 

Result:

Vendor NameColor% of Spend per Color per vendor
xBlue17%
yBlue50%
zBlue33%
xRed18%
yRed36%
zRed45%
1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @Pedro14 

 

Try this measure:

 

Measure = 
Var _TotalC = CALCULATE(sum('Table'[Spend$]),filter(ALL('Table'),'Table'[Color]=max('Table'[Color])))
Var _SC = max('Table'[Spend$])
return
_SC/_TotalC

 

 

Output:

VahidDM_0-1637140087336.png

 

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

2 REPLIES 2
VahidDM
Super User
Super User

Hi @Pedro14 

 

Try this measure:

 

Measure = 
Var _TotalC = CALCULATE(sum('Table'[Spend$]),filter(ALL('Table'),'Table'[Color]=max('Table'[Color])))
Var _SC = max('Table'[Spend$])
return
_SC/_TotalC

 

 

Output:

VahidDM_0-1637140087336.png

 

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Thanks a lot. It works!

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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