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
Himanshu_1306
Helper V
Helper V

Running total till current week

Hi All,

 

I have a sitution where I have created a quick measure for the running total but the measure is running for the entire weeks of the quarter. 

 

Is there a way I can filter that the measure runs only till today or the current week instead of the entire duration of the quarter?

 

Regards

 

10 REPLIES 10
Ahmedx
Super User
Super User

plse try this

SQO Running =
VAR _today =  TODAY()
VAR _EndWeek = _today-WEEKDAY(_today,2) +7
CALCULATE([SQO Count],
filter(All(F_PIPEGEN[FULL_DATE]),
           F_PIPEGEN[FULL_DATE] <=_EndWeek))


- - - -
SQO Running =
VAR _today =  TODAY()
CALCULATE([SQO Count],
filter(All(F_PIPEGEN[FULL_DATE]),
           F_PIPEGEN[FULL_DATE] <=_today))

No luck, It gives be number for that week but I want the running total number.

The next week should have numbers from the previous week also.

 

Himanshu_1306_0-1683623223534.png

 

SQO Running =
VAR _today =  TODAY()
VAR _EndWeek = _today-WEEKDAY(_today,2) +7
CALCULATE([SQO Count],
filter(All(F_PIPEGEN[FULL_DATE]),
           F_PIPEGEN[FULL_DATE] <=_EndWeek))

Look carefully, I didn't write that.

VAR _today =  TODAY()

 

Screen Capture #1083.png

can you explain normally what period you need

Himanshu_1306_0-1683625466833.png

 

 

Period is already selected i.e this quarters all weeks and the data is also coming correct when I'm checking data for a particular week for example you can see below for first week numbers are 500 and for 2nd week they are 80 so instead of this what I want is my 2nd weeks numbers should be the rolling sum i.e 580 instead of just 80

 

 

Himanshu_1306_1-1683625550299.png

Himanshu_1306_2-1683625586637.png

 

Himanshu_1306
Helper V
Helper V

@Greg_Deckler @Ahmedx any help here as needs to resolve this urgently.

 

I have tried using few other measures like the below but still didn't find the solution yet.

 

Measures Tried:

 

SQO Running =

CALCULATE([SQO Count],filter(all(F_PIPEGEN[FULL_DATE]),F_PIPEGEN[FULL_DATE] <=max(F_PIPEGEN[FULL_DATE]) && F_PIPEGEN[FULL_DATE]<= today() ))

 

SQO Running = 

IF(
[SQO Count] <> BLANK(),
CALCULATE(
[SQO Count],
FILTER(
ALL(F_PIPEGEN[FULL_DATE]),
F_PIPEGEN[FULL_DATE] <= MAX(F_PIPEGEN[FULL_DATE])
)
)
)

amitchandak
Super User
Super User

@Himanshu_1306 ,

try like

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date]) && 'Date'[date]<= today()  ))

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date]) && 'Date'[date]<= today() ))

 

or

 

Cumm Sales = if(max('Date'[date]) <= today(), blank(), CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date]))) )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak The calculation is running for each week but when going to the next week i want the previous number added to that week to make it a running total. Like in the below screenshot the first week shows SQO Running number to be 499 and in next week its showing 5. Instead of 5 it should show 499+5 = 504.

 

Himanshu_1306_0-1683608128251.png

Himanshu_1306_1-1683608303568.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.