Forum Discussion

my_microsoftacc's avatar
my_microsoftacc
Frequent Visitor
2 years ago

Calculation issues - weird grouping based on the numerical values

Hi everyone, 

I have a database of different companies' capacity per year.

The measures I created are:

  • YTD Capacity: calculates the accumulated capacity up until the year before the filtered year. 
YTD Capacity = CALCULATE(sum('Table'[Capacity]),filter(all('Table'[Year]),'Table'[Year]<Max('Table'[Year])))
  • Total capacity: calculates the total capacity of all years.
Total Capacity = calculate(sum('Table'[Capacity]),all('Table'[Year]))
 
However, for some reason, PowerBI calculates the sum based on the distinct values of the capacity. As seen in pic below, e.g: year 2015 with capacity of 120 is one group, year 2016 - 2019 with the same capacity of 150 is one group, capacity of 153 is one group etc..
The data shown belongs to one company.
Does anyone know what might be the reason for it and how to fix it? Thanks
 

3 Replies