Forum Discussion
Power BI table sum
- Anonymous4 years ago
Hi Learner_SG ,
1. Here are many methods to calculate the sum.
- Change the summarize type ——Hour:Don't summarize ; Usage: Sum:
- Create a measure
Measure = CALCULATE(SUM('Table'[usage]),FILTER('Table',[hour]=MAX('Table'[hour]))) //or //CALCULATE(SUM('Table'[usage]),ALLEXCEPT('Table','Table'[hour]))- Create a column:
Column = CALCULATE(SUM('Table'[usage]),FILTER('Table',[hour]=EARLIER('Table'[hour]))) // or //CALCULATE(SUM('Table'[usage]),ALLEXCEPT('Table','Table'[hour]))- Create a new table:
New Table = SUMMARIZE('Table','Table'[hour],"total usage",SUM('Table'[usage]))2. if I want to narrow it down for each day and hours, how should I modify the query?
What does "narrow down" mean? Can you please share more detail information to help us clarify your scenario?
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Learner_SG ,
1. Here are many methods to calculate the sum.
- Change the summarize type ——Hour:Don't summarize ; Usage: Sum:
- Create a measure
Measure = CALCULATE(SUM('Table'[usage]),FILTER('Table',[hour]=MAX('Table'[hour])))
//or
//CALCULATE(SUM('Table'[usage]),ALLEXCEPT('Table','Table'[hour]))
- Create a column:
Column = CALCULATE(SUM('Table'[usage]),FILTER('Table',[hour]=EARLIER('Table'[hour])))
// or
//CALCULATE(SUM('Table'[usage]),ALLEXCEPT('Table','Table'[hour]))
- Create a new table:
New Table = SUMMARIZE('Table','Table'[hour],"total usage",SUM('Table'[usage]))
2. if I want to narrow it down for each day and hours, how should I modify the query?
What does "narrow down" mean? Can you please share more detail information to help us clarify your scenario?
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous Is there any other way for calculation of the usage ,because it worked fine earlier. now my data is growing bigger and the number of rows are higher and it causes power bi to have slower performance.