filmov
tv
Running Total in Power BI for non date Values | How to calculate running total in Power BI using DAX

Показать описание
#dax #powerbi_training #powerbidax
We learn how to calculate running total in Power BI for non date values using DAX.In the earlier video we found out the process to create a running total for date values.So we have two options for the running total :
1.Option 1: Using sort on country column.Here we apply the below logic in DAX and create a measure as shown :
RT for Country =
CALCULATE([Sum_Sales],
FILTER(ALL(DimGeography[EnglishCountryRegionName]),
DimGeography[EnglishCountryRegionName]less than =max(DimGeography[EnglishCountryRegionName])
))
RT for Sales_Amount =
var current_Rank=RANKX(ALL(DimGeography[EnglishCountryRegionName]),
[Sum_Sales],,DESC,Dense)
var Result=CALCULATE([Sum_Sales],
FILTER(ALL(DimGeography[EnglishCountryRegionName]),
RANKX(ALL(DimGeography[EnglishCountryRegionName]),
[Sum_Sales],,DESC,Dense) less than=current_Rank)
)
return Result
This is a really useful feature and one that you should definitely learn how to use!
Check out other Power BI Tutorials Videos :
17.How to calculate Running total for date values in Power BI
Learn Power BI through our vlog and Free Videos:
You can download the pbix file for your self practice sessions from :
Do not forget to Like ,Subscribe and comment which keeps me motivated !
We learn how to calculate running total in Power BI for non date values using DAX.In the earlier video we found out the process to create a running total for date values.So we have two options for the running total :
1.Option 1: Using sort on country column.Here we apply the below logic in DAX and create a measure as shown :
RT for Country =
CALCULATE([Sum_Sales],
FILTER(ALL(DimGeography[EnglishCountryRegionName]),
DimGeography[EnglishCountryRegionName]less than =max(DimGeography[EnglishCountryRegionName])
))
RT for Sales_Amount =
var current_Rank=RANKX(ALL(DimGeography[EnglishCountryRegionName]),
[Sum_Sales],,DESC,Dense)
var Result=CALCULATE([Sum_Sales],
FILTER(ALL(DimGeography[EnglishCountryRegionName]),
RANKX(ALL(DimGeography[EnglishCountryRegionName]),
[Sum_Sales],,DESC,Dense) less than=current_Rank)
)
return Result
This is a really useful feature and one that you should definitely learn how to use!
Check out other Power BI Tutorials Videos :
17.How to calculate Running total for date values in Power BI
Learn Power BI through our vlog and Free Videos:
You can download the pbix file for your self practice sessions from :
Do not forget to Like ,Subscribe and comment which keeps me motivated !
Комментарии