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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Rajiv1237
Resolver I
Resolver I

Running total through direct query mode in PowerBI

I can't find a way to calculate a running total, without using FILTER. Filter is not supported in PowerBi direct query-mode.

All help is appreciated

 

Not supported in Direct Query Mode 😞

 

Running Total in DAX = CALCULATE( SUM('Table'[QTY]),
    FILTER(
        ALLSelected('Table'),
        'Table'[Date] <= MAX('Table'[Date])
    )

2 ACCEPTED SOLUTIONS

Hi @Rajiv1237,

 

Did you turn on the "allow unrestricted measures in directquery mode" option? If not you can turn on it first.

In addition, my formual is a measure, don't put it in calculate column.

 

Regards.

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

RunningTotalinPowerBI = SUMX(FILTER(ALLSELECTED(YearQty), YearQty[DateKey]<=MAX(YearQty[DateKey])), YearQty[Qty])

 

Filter works in Direct Query Mode: We have to check the option in Power BI desktop ‘Allow unrestricted measures in DirectQuery mode’

 

File -> Option and settings -> Option

 

Settings.PNG

View solution in original post

6 REPLIES 6
v-shex-msft
Community Support
Community Support

Hi @Rajiv1237,

 

You can use power query to calculate the running total at query editor side.

 

For detailed information you can take a look at below blog:

Create Running Totals in Power Query

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

We can't apply this in Power BI.

 

We should find some simple solution to get running total in Power BI direct query mode.

Hi @Rajiv1237,

 

I test with below measure at direct query mode, it works smooth, perhaps you can try it.

 

Running Total = SUMX(FILTER(ALL(Table),Table[Date]<=MAX(Table[Date])),[QTY])

 

Regarsd,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Its DirectQuery Mode not Loading the data into PowerBI.

 

Filter function doesn't work in PowerBI Direct Query Mode

 

Filter function doesn't work in Direct Query ModeFilter function doesn't work in Direct Query Mode

Hi @Rajiv1237,

 

Did you turn on the "allow unrestricted measures in directquery mode" option? If not you can turn on it first.

In addition, my formual is a measure, don't put it in calculate column.

 

Regards.

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

RunningTotalinPowerBI = SUMX(FILTER(ALLSELECTED(YearQty), YearQty[DateKey]<=MAX(YearQty[DateKey])), YearQty[Qty])

 

Filter works in Direct Query Mode: We have to check the option in Power BI desktop ‘Allow unrestricted measures in DirectQuery mode’

 

File -> Option and settings -> Option

 

Settings.PNG

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.