- Forums
- Get Help with Power BI
- Desktop
- Service
- Report Server
- Integrations with Files and Services
- Mobile Apps
- Developer
- DAX Commands and Tips
- Let's Talk Data
- Custom Visuals Development Discussion
- Community Support
- Welcome to the Community
- Community Feedback
- Community Help Blog
- Training and Consulting
- Dashboard in a Day
- EdX Specific Training Discussion Forum

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Microsoft Power BI Community
- Forums
- Get Help with Power BI
- Desktop
- Re: Calculate the sum of a measure

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

CloudMonkey

Member

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-09-2018
03:11 AM

Hi,

I have a column of sales volumes with the rows being branch numbers.

I'd like to a calculated measure showing the "% weighting " versus the total. I know I can use "Show Value As -> % of Grand Total" but I'd like the result in a calculated measure that I can use elsewhere.

Please can you tell me how to calculate the sum of the volumes? (in order to allow me to calculate the % weighting)

Thanks,

CM

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

Stachu

Super User

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-09-2018
06:15 AM

for a measure (assuming it's sum of sales) syntax would look like this

% weighting all selected = VAR CurrentSales = [your measure] VAR AllSelectedSales = CALCULATE([your measure],ALLSELECTED('Table')) RETURN DIVIDE(CurrentSales,AllSelectedSales)

without sample data & measure syntax from your side I cannot provide more specific info

4 REPLIES 4

Highlighted
##

Stachu

Super User

Re: Calculate the sum of a measure

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-09-2018
03:31 AM

depending whether you need the weight to be as per overall total or currently selected you may select between the 2:

% weighting all selected = VAR CurrentSales = SUM('Table'[Sales Volume]) VAR AllSelectedSales = CALCULATE(SUM('Table'[Sales Volume]),ALLSELECTED('Table')) RETURN DIVIDE(CurrentSales,AllSelectedSales)

% weighting all= VAR CurrentSales = SUM('Table'[Sales Volume]) VAR AllSales = CALCULATE(SUM('Table'[Sales Volume]),ALL('Table')) RETURN DIVIDE(CurrentSales,AllSales)

CloudMonkey

Member

Re: Calculate the sum of a measure

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-09-2018
06:02 AM

Is there a way to sum calculated measures? (I think you are summing calculated fields?)

Thanks

Stachu

Super User

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-09-2018
06:15 AM

for a measure (assuming it's sum of sales) syntax would look like this

% weighting all selected = VAR CurrentSales = [your measure] VAR AllSelectedSales = CALCULATE([your measure],ALLSELECTED('Table')) RETURN DIVIDE(CurrentSales,AllSelectedSales)

without sample data & measure syntax from your side I cannot provide more specific info

CloudMonkey

Member

Re: Calculate the sum of a measure

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-09-2018
06:32 AM

Brilliant, thank you Stachu This may lead to a follow up question but I'll start another thread...