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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
lakshmi_alla
Frequent Visitor

Running Total in Direct Query with multiple filter

Hi All,

I had written a formula in dax for calculating running totals using alllselect function which is generating incorrect results when used with slicer.

 

Table1

COL1 COL2

1        10

2        20

3        30

4        40

 

DAX formula :

 

Calculate ( SUM (Table1[Col2]),

FILTER (ALLSELECTED(Table1) ,COL2> SUM COL2))

 

I had a slicer which is build on Table2 that in turns filter Table1

When I apply the slicer will filter record with value 3 and 4.

 

 

Running total results when presented on table :

 1       30

 2       50

 3       60

 4       60

 5       60

The last  2 records should not be shown as its been indrectly filtered by the slicer build on Table1 but its been shown with grand total value 

 

Please help !!

1 REPLY 1
Eric_Zhang
Microsoft Employee
Microsoft Employee


@lakshmi_alla wrote:

Hi All,

I had written a formula in dax for calculating running totals using alllselect function which is generating incorrect results when used with slicer.

 

Table1

COL1 COL2

1        10

2        20

3        30

4        40

 

DAX formula :

 

Calculate ( SUM (Table1[Col2]),

FILTER (ALLSELECTED(Table1) ,COL2> SUM COL2))

 

I had a slicer which is build on Table2 that in turns filter Table1

When I apply the slicer will filter record with value 3 and 4.

 

 

Running total results when presented on table :

 1       30

 2       50

 3       60

 4       60

 5       60

The last  2 records should not be shown as its been indrectly filtered by the slicer build on Table1 but its been shown with grand total value 

 

Please help !!


@lakshmi_alla

You description is not clear, I don't see any information of table2. Could you post some sample data for Table2? By the way, where is the column1 5 from? I only see 1,2,3,4 in table1 in your original post.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.