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.
I want to calculate Total Count of each year in DAX when i have multiple years in my dataset as shown below,
Year | Month | Count of WO | Total Count of each year |
2018 | March | 467 | 628 |
2018 | April | 20 | 628 |
2018 | May | 141 | 628 |
2019 | January | 161 | 10731 |
2019 | February | 402 | 10731 |
2019 | March | 9903 | 10731 |
2019 | April | 265 | 10731 |
2020 | January | 828 | 62806 |
2020 | February | 400 | 62806 |
2020 | March | 28801 | 62806 |
2020 | April | 5904 | 62806 |
2020 | May | 5685 | 62806 |
2020 | June | 3209 | 62806 |
2020 | July | 2484 | 62806 |
2020 | August | 2095 | 62806 |
2020 | September | 1823 | 62806 |
2020 | October | 3094 | 62806 |
2020 | November | 3930 | 62806 |
2020 | December | 4553 | 62806 |
2021 | January | 2977 | 12569 |
2021 | February | 1550 | 12569 |
2021 | March | 6338 | 12569 |
2021 | April | 441 | 12569 |
2021 | May | 512 | 12569 |
2021 | June | 751 | 12569 |
Thanks
Solved! Go to Solution.
Hi @abatwara ,
If the count of WO value is written in measure, please refer to the following formula,
result_M = SUMX(FILTER(ALL('Table'),'Table'[Year]=MAX('Table'[Year])),[cout of wo])
if the count of WO value is written in column, please refer to the following formula.
Measure = CALCULATE(SUM('Table'[Count of WO]),FILTER(ALL('Table'),'Table'[Year]=SELECTEDVALUE('Table'[Year])))
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards
Community Support Team _ Polly
Hi @abatwara ,
If the count of WO value is written in measure, please refer to the following formula,
result_M = SUMX(FILTER(ALL('Table'),'Table'[Year]=MAX('Table'[Year])),[cout of wo])
if the count of WO value is written in column, please refer to the following formula.
Measure = CALCULATE(SUM('Table'[Count of WO]),FILTER(ALL('Table'),'Table'[Year]=SELECTEDVALUE('Table'[Year])))
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards
Community Support Team _ Polly
Another way is to achieve the above calculation apart from @v-rongtiep-msft mentioned is like
_Year Total = CALCULATE(SUM('Table (2)'[Count of WO]),ALLEXCEPT('Table (2)','Table (2)'[Year]))
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |