cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

TOTALYTD with Categories doesn't correctly aggregate

I have a data set with the following format:

 

Category          Type         Date     Hours
A               Billable    1/1/2018    8
A               Billable    1/2/2018    10
A               Billable    1/3/2018    7
B               Billable    1/4/2018    8
B               Billable    1/5/2018    10
B               Billable    1/6/2018    7
Not assigned    Available   1/1/2018    8
Not assigned    Available   1/2/2018    8
Not assigned    Available   1/3/2018    8
Not assigned    Available   1/4/2018    8
Not assigned    Available   1/5/2018    8
Not assigned    Available   1/6/2018    8

 

I've got a cumulative calculation using TOTALYTD. The calculation is YTD utilization of a resource (i.e., Billable / Available). So, the formula is:

ytd_billable = TOTALYTD(Sum(Hours[Hours]),Hours[Date],Hours[Type]="Billable")
ytd_available = TOTALYTD(Sum(Hours[Hours]),Hours[Date],Hours[Type]="Available")
ytd_utilization = [ytd_billable] / [ytd_available]

Now, this works just fine when I plot this with date as the x axis and ytd_utilization as the values of the plot. However, when I add Category to the chart, I get infinity for each group rather than the value of ytd_utilization for each level of Category. How do I get the desired behavior? See graphs below for what I'm looking for (graphs are based different data, but same structure):

 

See this post for the images: my post on StackOverflow

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: TOTALYTD with Categories doesn't correctly aggregate

@rerwin21,

 

There's already an answer at https://stackoverflow.com/questions/49758356/totalytd-with-categories-doesnt-correctly-aggregate-pow....

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Regular Visitor

TOTALYTD with Categories doesn't correctly aggregate

I have a data set with the following format:

Category          Type         Date     Hours
A               Billable    1/1/2018    8
A               Billable    1/2/2018    10
A               Billable    1/3/2018    7
B               Billable    1/4/2018    8
B               Billable    1/5/2018    10
B               Billable    1/6/2018    7
Not assigned    Available   1/1/2018    8
Not assigned    Available   1/2/2018    8
Not assigned    Available   1/3/2018    8
Not assigned    Available   1/4/2018    8
Not assigned    Available   1/5/2018    8
Not assigned    Available   1/6/2018    8

I've got a cumulative calculation using TOTALYTD. The calculation is YTD utilization of a resource (i.e., Billable / Available). So, the formula is:

ytd_billable = TOTALYTD(Sum(Hours[Hours]),Hours[Date],Hours[Type]="Billable")
ytd_available = TOTALYTD(Sum(Hours[Hours]),Hours[Date],Hours[Type]="Available")
ytd_utilization = [ytd_billable] / [ytd_available]

Now, this works just fine when I plot this with date as the x axis and ytd_utilization as the values of the plot. However, when I add Category to the chart, I get infinity for each group rather than the value of ytd_utilization for each level of Category. How do I get the desired behavior? See graphs here for what I'm looking for.

Highlighted
Community Support
Community Support

Re: TOTALYTD with Categories doesn't correctly aggregate

@rerwin21,

 

There's already an answer at https://stackoverflow.com/questions/49758356/totalytd-with-categories-doesnt-correctly-aggregate-pow....

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors