Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
adavid999
Helper V
Helper V

Simple calculation

Hi,

Please could you remind how best to acheive this...I have table data and would like a new column or measure that shows sum of score for each question based on year, so total for question 1 would be 5, and question 2 would be 6, question 3 would be 8.

Thanks!

A

 

Question

Year

Score
120192
120183
220193
220183
320194
320184
7 REPLIES 7
FrankAT
Community Champion
Community Champion

Hi @adavid999 ,

take a look at the figure:

30-03-_2020_17-47-21.png

 

Regards FrankAT

 

Thanks @FrankAT I guess i should have been clearer - i need to be able to use the sum in another calculation.

Cheers,

A

@adavid999 - If you need the sum in a different calculation it would help to know the calculation. But, in general you could do something like:

 

Measure = 

  VAR __Table = SUMMARIZE('Table',[Question],"__Score",SUM([Score]))

RETURN

  <some calculation across __Table>



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

thanks @Greg_Deckler I will try this and if I don't get anywhere (likely) I will try and more clearly state what I am trying to acheive...

A

Greg_Deckler
Community Champion
Community Champion

Just put Question in a table visualization along with Score and use default Sum aggregation for Score?


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@adavid999 

If plot sum(Table[Score]) By question and year it should give you that

 

Or you want this year vs last year

This Year = calculate(Sum(Table[Score])filter(all(Table),Table[Year] =max(Table[Year])))
last Year = calculate(Sum(Table[Score])filter(all(Table),Table[Year] =max(Table[Year])-1))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for quick response @amitchandak . I need the result of sum for both years to be used in another calculation. There are many questions, with many different potential filters to view the scores. I'm not sure if plot sum(Table[Score]) will get me there, but will try.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.