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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
temuulenchoi
Frequent Visitor

Count certain values that persist throughout dates

Hi all,

 

i was wondering if it's possible to do a calculation for the following example table, when a certain value continues unchanged, for example, more than 7 days, it would start to count those rows. The measure for the following example should return 36.

Cumulative TotalDate
52022/08/15
52022/08/14
52022/08/13
52022/08/12
52022/08/11
52022/08/10
52022/08/09
52022/08/08
52022/08/07
52022/08/06
52022/08/05
52022/08/04
52022/08/03
52022/08/02
52022/08/01
52022/07/31
52022/07/30
52022/07/29
52022/07/28
52022/07/27
52022/07/26
52022/07/25
52022/07/24
52022/07/23
52022/07/22
52022/07/21
52022/07/20
52022/07/19
52022/07/18
72022/07/17
72022/07/16
102022/07/15
152022/07/14
202022/07/13
242022/07/12
332022/07/11
332022/07/10
332022/07/09
422022/07/08
52022/07/07
52022/07/06
52022/07/05
52022/07/04
52022/07/03
52022/07/02
52022/07/01

Thank you very much for your help!

5 REPLIES 5
ribisht17
Super User
Super User

Sorry V Confusing explanation

Anonymous
Not applicable

Hi @temuulenchoi ,

 

I'm sorry I don't seem to understand the logic of your calculation, how did you calculate the "36"? Am I wrong in understanding that when the value is always 5 and has not changed for more than seven days, the total number of rows is counted from the next row?

 

Best regards,

Community Support Team Selina zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi there @Anonymous ,

 

what I'm trying to find is to count the rows that contain same values, that are same for 7 or more days consecutively. 
For example, if the values between 2022/07/01 and 2022/07/07 (which are 7 consecutive days) stays 5, it would count as 7. But if the value stays for 3 consecutive days and changes by the next date, this will not be counted.

ribisht17
Super User
Super User

@temuulenchoi 

 

Step 1Turn Cumulative Total to Don't Summarise

Step 2 Get the Count of Dates,

 

ribisht17_1-1660532068766.png

 

To avoid other values,set the Filter Count of Date as  > 7

ribisht17_3-1660532440079.png

 

 

 

Thanks,

Ritesh

 

Sorry this is not the solution. The value 5 was just an example, it can be 30, or even 100. It is the count of rows that continues to be the same for more than a certain amount of days (more than 7 days for example). And the measure should return count of the days

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.