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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
project101
Frequent Visitor

Running Totals in Power Query with slicer

There are several very fast calculation methods through m - query as List.Generate and in 

dax language with measures

CALCULATE(
    SUM('sales'[val]),
    FILTER(
        ALLSELECTED('sales'[period]),
        ISONORAFTER('sales'[period], MAX('sales'[period]), DESC)
    )

 

The  problem is to   add a sample filter in slicer with dates

the expression of run total Not recalculated as it is calculated in Dax
In fact the query should  recalculate the filter    and only then calculate

List.Generate , List.Sum or List.FirstN  for the column

 

#"Added Index" = Table.AddIndexColumn(#"**Prior Step**", "Index", 0, 1)

#"Added Running Total" = Table.AddColumn(#"Added Index", "Running Total, each List.Sum(List.FirstN(#"Added Index"[**Column to Add Values From**],[Index]+1)))

I assume there is a possibility through m - query

3 REPLIES 3
v-angzheng-msft
Community Support
Community Support

Hi, @project101 

 

May I ask if your problem has been solved?  Is the above post helpful to you?

If  it does, could you please mark the post which help as Answered? It will help the others in the community find the solution easily if they face the same problem with you.  Thank you.

 

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-angzheng-msft
Community Support
Community Support

Hi, @project101 

 

When you filter the data in a power query, once the previous steps are calculated, the later steps are always based on the results of the previous calculations. power query does not check all calculations forever like measures do, it is more like what the calculated columns do. If you wish to recalculate, then you re-add the index and run the total column.

vangzhengmsft_0-1634180039742.png

 

 

Hope this helps.

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@project101 , I doubt you can recalculate a power query column with a filter.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors