Forum Discussion
Sum Groupby only for current year
- Anonymous5 years ago
Hi AleFVG ,
Here is my data sample and pbix file.
2020-1-1 1 2019-1-1 2 2019-1-1 3 2018-2-2 4 2018-3-2 5 2020-1-1 6 In my test, your GROUPBY() formula returns a new table like this:
According to my understand, you want to calculate the sum of each year, or just the current year(2020) , right?
You could use the following formula:
Measure = CALCULATE ( SUM ( 'Table1'[Value] ), FILTER ( ALL ( 'Table1' ), 'Table1'[Year] = MAX ( 'Table1'[Year] ) ) )SumCurrentYear = IF ( MAX ( 'Table1'[Year] ) = YEAR ( TODAY () ), CALCULATE ( SUM ( 'Table1'[Value] ), FILTER ( ALL ( 'Table1' ), 'Table1'[Year] = YEAR ( TODAY () ) ) ) )Or create a column
Column = CALCULATE ( SUM ( 'Table1'[Value] ), ALLEXCEPT ( Table1, Table1[Year] ) )My visualizations are shown below:
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.Best Regards,
Eyelyn Qin
Hi AleFVG ,
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Eyelyn Qin