Forum Discussion
Lsuhajda
3 years agoNew Member
Running total based on ranking
Hi all,
I am new to DAX and I am working with a sample Contoso Database available from the link below:
https://github.com/sql-bi/Contoso-Data-
Generator/releases/download/v1.0.0/Contoso.100K.bak.
I am trying to create a DAX expression that performs a cumualtive total of Quantity on Customer Full Name.
Customer data is from Data Customer table and Quantity is coming from Data Order Rows. These tables are joined by
Data Customer (Customer Key) - Data Orders (Customer Key) - Data Order Rows (Order Key)
My Expresisons is from the Running total is:
RT= VAR IND=[RANKING]
RETURN
CALCULATE (SUM
sum('Data OrderRows'[QUANTITY]),
FILTER(
ALL('Data Customer'[FULL NAME]),
IND>RANKX(ALL('Data Customer'[FULL NAME]),'Data Customer'[RANKING])))
- [Customer] - Full Name is in Data Customer table and derived as :
Full Name = CONCATENATE('Data Customer'[GivenName],'Data Customer'[Surname])
-[Ranking] - (ALL('Data Customer'[Full Name]),[measure],,desc)
-[Measure] - SUM('Data OrderRows'[Quantity])
I have a table where i show Full Name ,ranking and Measure order Descending based on Ranking. The new Column I try to add is th cumulative total of the Measure. Using the above Expression for RT does not give an error but the table goes blank.
Please let me know if you have any ideas or need more info,context
Thanks
No RepliesBe the first to reply