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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Frequent Visitor

Running Total with filters from different tables


I've been struggling to understand what's wrong with my DAX code for Running Total and would appreciate some help from experts in this forum.


I have a matrix with Customer table and two measures - Revenue YTD and Operating Profit. I next wrote a RANX measure, ranking Customers based on Operating Profit. I then attempted to write DAX code for Cumulative OP. The issue is I want to maintain the filters from the Entity table (Business Group Column) and Date table (FY and Mth-Yr) - but could not get it to work. My current code is clearly wrong as it does not sum up the preceding values. 

Would really appreciate some help, thanks!








Frequent Visitor

Thanks @Fowmy . I think I understand the syntax you provided. The ALLSELECTED will remove all filters on the Product column, but in my case the filters I have applied -Date and Entity are from different tables from the Customer table. That is why I tried using ALLEXEPT. Any ideas, thanks.


If you can share a dummy Power BI file similar to your model and explain what you are trying to achieve then it will be easier for me to provide a solution.

Did I answer your question? Mark my post as a solution! and hit thumbs up

Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thanks @Fowmy , I appreciate your help. I'm basically trying to calculate Cumulative Totals for the ranked Customer profits without removing the page filters.  Some call this a Pareto analysis while  others call it a whale curve. The idea is a curve that starts sloping up with the most profitable customers and ends with a downward slope indicating loss making customers. ( In my case the X-axis is simply a list of Customers ranked on highest profit to lowest and Y-axis is the Cumulative Profits. Is the Y axis that I have difficulty calculating.


Here is the pbix file.


Once again thanks in advance!


Hi @gpillai99 

Can you describe what results you want to get based on the re-shared sample file? Thanks!



Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Super User
Super User

You can use a formula as I did with a sample dataset, please check and modify your accordingly. You do not need to use rankx for this. File is attached 


Cumm Units = 
VAR __UNITS =   [Total Units]
        [Total Units],
            [Total Units] >= __UNITS




Did I answer your question? Mark my post as a solution! and hit thumbs up

Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Power BI Header Change

Power BI Header Update

Read about the exciting updates for the Power BI forum.