Aug 24 2024 12:40 PM
Hi all,
I am using Power Pivot in Excel and want to calculate the running total without Date column.
I found the following tutorial, which is for DAX in Power BI and tried to convert this to Excel Power Pivot but I am not able to do so.
Please can you help me converting this so that I can use it in Excel.
https://www.antmanbi.com/post/how-to-create-running-total-on-non-numeric-fields.
I am attaching a sample data table.
Running Total Brands =
VAR CurrentBrandSales =
[Total Sales]
VAR BrandsWithSales =
ADDCOLUMNS (
ALLSELECTED ( Products[Brand] ),
"@Sales", [Total Sales]
)
VAR BrandsWithHigherSales =
FILTER ( BrandsWithSales, [@Sales] >= CurrentBrandSales )
VAR Ranking =
-- Used only for confirming the ranking
COUNTROWS ( BrandsWithHigherSales )
VAR Result =
SUMX ( BrandsWithHigherSales, [@Sales] )
RETURN
Result
Thanks,
Naveen
Sep 02 2024 02:12 AM
Hi @naveen73
Measure [Run_Total]:
=
VAR CurrentBrandSales =
MIN ( Products[Total Sales] )
VAR BrandsWithSales =
ADDCOLUMNS ( ALLSELECTED ( Products ), "@Sales", Products[Total Sales] )
VAR BrandsWithHigherSales =
FILTER ( BrandsWithSales, [@Sales] >= CurrentBrandSales )
RETURN
SUMX ( BrandsWithHigherSales, [@Sales] )