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
rerwin21
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
v-chuncz-msft
Community Support
Community Support

@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
v-chuncz-msft
Community Support
Community Support

@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.
rerwin21
Regular Visitor

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.

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.