Forum Discussion
Sandeep13
3 years agoHelper III
Add same column rows with same column next row
Hi All I have one column called ColumnA andI want some like below in Total column in powerbi. Note: I dont have any other column in data model. ColumnA Total 0.15% 0.14% 0.29% 0.1...
- Anonymous3 years ago
Hi Sandeep13 ,
It is working for me. Please see below screenshot :Try to adding the Index column in Power Query editor using this
Please sort your table before adding the Index column.
Sandeep13
3 years agoHelper III
Hey
Thank you for your response. But I am getting data like this when i apply your logic in my data.
Total (column) =
var previndex = CALCULATE(MAX(Sheet1[Index]) - 1)
var prevvalue = CALCULATE (SUM (Sheet1[Sales_Percentage]),FILTER (Sheet1,Sheet1[Sales_Percentage] = EARLIER (Sheet1[Index]) - 1))
Return
IF(previndex > 0, CALCULATE(SUM(Sheet1[Sales_Percentage]) + prevvalue), BLANK())
Note: I created index column
kIndly check
- Anonymous3 years agoNot applicable
Hey Sandeep13
Can you please try to change the column name from "Index" to something else?
Since it is a Power BI keyword it might affect the calculation. I faced this same issue in the begining when i was solving your problem statement.