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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Step927
Regular Visitor

Consecutive days with no increment in Running Total

Dear All,

 

I want to create a calculated column that returns a string if a Player has an increment in goal scored compared with the previuos day.
Please consider that  "goal " is a running total. I cannot change the data source.

cc48386e-7cb4-44a6-b721-afe463cd9d10.png

If you have an increment return "New goal", if the score is equal return "No".
Attached the table as example.
Many Thanks

1 ACCEPTED SOLUTION

Hi,

Try this calculated column formula

Column = calculate(countros(Data),filter(Data,Data[Name]=earlier(Data[Name])&&Data[Day]<=earlier(Data[Day])&&Data[Goal]=earlier(Data[Goal])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
DataStep
New Member

Hi rajen,

thank you it works very well!

In addiction, which will be the best way to return the count of consecutive giornata with "No".
Looking the table I attached, for the day 7 the correct value would be 0.
For the day 15 the correct value would be 3,
For the day 16 the correct value would be 4
Fo the day 17 the count restart from 0.

Do you suggest a measure or a new calculated column?
Many Thanks

Hi,

Try this calculated column formula

Column = calculate(countros(Data),filter(Data,Data[Name]=earlier(Data[Name])&&Data[Day]<=earlier(Data[Day])&&Data[Goal]=earlier(Data[Goal])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

It works correctly!! Many Thanks

You are welcome.  If my reply helped, please mark it as Answer.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
rajendraongole1
Super User
Super User

Hi @Step927 - Create a new calculated column by clicking on Modeling > New column.

you can replace 'YourTable' with the name of your actual table.

 

Goal Status =
VAR CurrentDay = 'YourTable'[Day]
VAR PreviousGoal =
CALCULATE(
MAX('YourTable'[Goal]),
FILTER(
'YourTable',
'YourTable'[Name] = EARLIER('YourTable'[Name]) &&
'YourTable'[Day] = CurrentDay - 1
)
)
RETURN
IF('YourTable'[Goal] > PreviousGoal, "New goal", "No")





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors