Forum Discussion
Calulating help
Hello !
How do you calculate minus in power bi, i.e. I have a baseline = 208 and then I have another field with values to be accumulated downwards, see my example:
Forecast is calculated from another variable called "Effekt CO2 (sustainability)"
| ÅR | Prognos |
| 2022 | 208 |
| 2023 | 208 |
| 2024 | 208 |
| 2025 | 187,18 |
| 2026 | 187,18 |
| 2027 | 182,58 |
| 2028 | 182,58 |
| 2029 | 176,28 |
| 2030 | 176,28 |
Hi Anonymous for solution as below, please create Date / Calendar Table in Power BI and connect / create relationship with your Year column.
After that please create following measures 83), adopt Sheet1 with your table name
To get visuals as below, please use Year colum from created Date / Calendar table
Sum of Base = SUM(Sheet1[Baseline])Sum of Effekt CO2 = sum(Sheet1[Effekt CO2])Running total =VAR __max_date = MAX ( 'Date'[Date] )VAR __base_line=[Sum of Base]VAR __running_total=CALCULATE ([Sum of Effekt CO2],'Date'[Date] <= __max_date,ALL ( 'Date' ))VAR __Result=__running_total+__base_lineRETURN __ResultDid I answer your question? Kudos appreciated / accept solution!
7 Replies
- some_bihCommunity Champion
Hi Anonymous "it depends 🙂", provide more model data, relationships and for variable to get some feedback as possible solution.
- AnonymousNot applicable
Hello again! That is, I want the calculations to start at 208, but then it should be accumulated based on this table:
- some_bihCommunity Champion
Hi Anonymous Inforande is Date type column? In column Basline there will be always single amount for each year, like 208?