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
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

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.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors