Forum Discussion
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.
- Total capacity: calculates the total capacity of all years.
3 Replies
- lbendlin
Super User
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - AnonymousNot applicable
Hi my_microsoftacc ,
I create a table as you mentioned.
I think you can change your DAX codes, here is my DAX code.
YTD Capacity1 = CALCULATE( SUMX( FILTER( ALL('Table'), 'Table'[Year] < MAX('Table'[Year]) ), 'Table'[Capacity] ) )Total Capacity1 = SUMX( ALL('Table'), 'Table'[Capacity] )Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- my_microsoftaccFrequent Visitor
Hi thanks for your response but unfortunately it does not work. Now it sums all capacity of all products and all companies I have in my database (I have more than one product, one company)