Forum Discussion
jgarden6
5 years agoFrequent Visitor
Need Help With Dax
I need help with Dax. I'm new to Dax so excuse my lack of knowledge. I have data that I want to sum a column for each year. I have data for years 2012 through 2020. I wnat a measure that shows th...
- 5 years ago
Hi jgarden6
Download sample PBIX with measures and data shown below.
I'm not sure what your data looks like - are you storing the year as text, a number or as a date?
But if your Year column is numerical and just holds the year then try this measure
Measure = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'), 'Table'[Year] = 2012))If you have a column of dates then use this measure
Measure 2 = CALCULATE(SUM('Table2'[Value]),FILTER(ALL('Table2'), YEAR('Table2'[Date]) = 2012))Regards
Phil
PhilipTreacy
5 years agoSuper User
Hi jgarden6
Download sample PBIX with measures and data shown below.
I'm not sure what your data looks like - are you storing the year as text, a number or as a date?
But if your Year column is numerical and just holds the year then try this measure
Measure = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'), 'Table'[Year] = 2012))
If you have a column of dates then use this measure
Measure 2 = CALCULATE(SUM('Table2'[Value]),FILTER(ALL('Table2'), YEAR('Table2'[Date]) = 2012))
Regards
Phil
- jgarden65 years agoFrequent Visitor
it worked . thank you so much.