cancel
Showing results for
Did you mean:
Super User

## Re: Percent of group total

Hi,

Share some data and show the expected result.

Member

## Re: Percent of group total

Hello,

Below is a table of sample data:

Following the steps in this post, I created the following measures:

%Activity = DIVIDE(SUM(TableA[Hours]), CALCULATE(SUM(TableA[Hours]), ALLSELECTED(TableA[Activity])))

%Charge = DIVIDE(SUM(TableA[Hours]), CALCULATE(SUM(TableA[Hours]), ALLSELECTED(TableA[Charge])))

%Employee = DIVIDE(SUM(TableA[Hours]), CALCULATE(SUM(TableA[Hours]), ALLSELECTED(TableA[Employee])))

Level1 = IF([%Activity]=1, [%Charge], [%Activity])

MeasureSelect = IF([Level1]=1, [%Employee], [Level1])

The resulting matrix is below:

:

Note that where there is a single value at the lowest level (e.g. under Customer Charge), the % is calculating as the % of that value across all employees, rather than for the single employee.  Each one of the lines for Project A should show 100% as it is 100% of the values under Customer Charge.  Non-customer Charges - where there are more than one at the lowest value - are calculating correctly.

Do you have any idea why this is happening and how to fix it?

- Stacey

Super User

## Re: Percent of group total

Hi,

Based on the first table that you have shared, please share the exact result you are expecting.  I will help you with writing the DAX formulas.

Member

## Re: Percent of group total

Hello,

Here are the reults I want.

- Stacey

Super User

Hi,

Member

## Re: Percent of group total

Hello,

The file can be found here:  https://1drv.ms/u/s!AjomjdFc4LMegbsBv_xr6JTOJBcTmQ

Thank you,

-Stacey

Super User

Hi,

Hope this helps.

Member

## Re: Percent of group total

Hello,

Thank you for the pbi file!  Curiously, why this works with my sample data, when I created corresponding 'Total hours' and 'Measure' in my actual pbi dataset it did not return the same results.  In this case, those with a single value at the lowest level correctly calculated to 100%, yet those with multiple values - which previously calculated correctly - now show erroneous %.  I cannot even determine what the % returned is representing.  I've uploaded the pbix here:  https://onedrive.live.com/?id=1EB3E05CD18D263A%2123936&cid=1EB3E05CD18D263A

Thank you,

- Stacey

Super User

## Re: Percent of group total

Hi,

There is no file that link.

Member

## Re: Percent of group total

Hello,

Thank you,

- Stacey

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and announcements.

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 60 members 1,255 guests
Recent signins: