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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rwelsh11
Frequent Visitor

Calculating Market Share Over Time

I am trying to display the marketshare for various accounts over time and am struggling with which DAX formula to use. I have a simple table (Week Ending Date, Account Name, Units Sold). I would like to display the marketshare for each account over time (year, month, week etc.). I would like to display this information with a line graph. Everything I try either calculates the marketshare based on the total period (i.e. the % of one weeks' sales for one account out of the total sales of all accounts across all time) or it shows all accounts at 100% for each week ending date. Can anyone help me??

1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @rwelsh11,

 

Could you try using the formula below to create a new measure to calculate marketshare, then show the measure as Values, "Week Ending Date" as Axis, and "Account Name" as Legend on the Line Chart visual to see if it works in your scenario? Smiley Happy

measure =
DIVIDE (
    SUM ( 'Table1'[Week End Date] ),
    CALCULATE ( SUM ( 'Table1'[Week End Date] ), ALL ( 'Table1'[Account] ) )
)

Remark: replace 'Table1' with your real table name.

 

Regards

View solution in original post

4 REPLIES 4
v-ljerr-msft
Employee
Employee

Hi @rwelsh11,

 

Could you try using the formula below to create a new measure to calculate marketshare, then show the measure as Values, "Week Ending Date" as Axis, and "Account Name" as Legend on the Line Chart visual to see if it works in your scenario? Smiley Happy

measure =
DIVIDE (
    SUM ( 'Table1'[Week End Date] ),
    CALCULATE ( SUM ( 'Table1'[Week End Date] ), ALL ( 'Table1'[Account] ) )
)

Remark: replace 'Table1' with your real table name.

 

Regards

This is great thanks!

rwelsh11
Frequent Visitor

I am trying to calculate the market share for a variety of accounts over several years and am struggling with the DAX. I have a very simple table (Week End Date, Account, Units Sold) and I am trying to graph the relative marketshare for each account with a line graph over time (week ending dates run 2014 - 2017). My challenge is that I either get the % of one weeks' sales at one account out of the total sales for all accounts across the entire period  or I see every data point at 100%. I basically want to calculate the marketshare for each account during a given week (totalling 100% for each week) and then graph that across all the weeks in a line graph. Please help!!

Hi,

 

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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