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
Anonymous
5 years agoNot applicable
HI jgarden6
Create a measure as below
measure1 = CALCULATE(SUM('table'[column]),FORMAT('table'[date],"YYYY") = "2012")
jgarden6
5 years agoFrequent Visitor
I had a syntax issue so I fixed that. It shows the summed value for 2012 but it is blank for all the other rows. I'm summing by year. When I do my divide (base year 2012 / each subsequent year , I get blanks for 2013 thru 2020 and that is because the 2012 sum is not shown for each year. Help again
- PhilipTreacy5 years agoSuper User