Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Lsuhajda
New 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)

 

Lsuhajda_0-1681799515235.png

 

 

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
0 REPLIES 0

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.