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
abatwara
New Member

How to calculate dynamic "Total Count of each year" in DAX as shown below?

I want to calculate Total Count of each year in DAX when i have multiple years in my dataset as shown below,

 

YearMonthCount of WOTotal Count of each year
2018March467628
2018April20628
2018May141628
2019January16110731
2019February40210731
2019March990310731
2019April26510731
2020January82862806
2020February40062806
2020March2880162806
2020April590462806
2020May568562806
2020June320962806
2020July248462806
2020August209562806
2020September182362806
2020October309462806
2020November393062806
2020December455362806
2021January297712569
2021February155012569
2021March633812569
2021April44112569
2021May51212569
2021June75112569

 

Thanks

1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

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])))

 

FFDB.PNG

 

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

View solution in original post

2 REPLIES 2
v-rongtiep-msft
Community Support
Community Support

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])))

 

FFDB.PNG

 

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]))






Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




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.