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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Show cumulative repetitions

Hello how are?

I have a problem that I can't solve, I wanted to know if someone comes up with an idea.

I have a table where a period and an ID appear, I need to show in a column the times the ID has been repeated, but taking into account the previous value.

I show you an example so that you can understand it simpler.

PeriodIDRepeated
20200112340
20200111110
20200245660
20200312341
20200412342

From now on thank you very much for any help!

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Syndicate_Admin 

Thanks for reaching out to us.

if you want to create a column, please try this,

Column = 
var _count=CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[ID]=EARLIER('Table'[ID]) && 'Table'[Period]<EARLIER('Table'[Period])))
return IF(ISBLANK(_count),0,_count)

vxiaotang_0-1666940773943.png

if you want to create a measure, please try this

measure = 
var _count=CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[ID]=MIN('Table'[ID]) && 'Table'[Period]<MIN('Table'[Period])))
return IF(ISBLANK(_count),0,_count)

vxiaotang_1-1666940837477.png

 

 

Best Regards,

Community Support Team _Tang

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

View solution in original post

1 REPLY 1
v-xiaotang
Community Support
Community Support

Hi @Syndicate_Admin 

Thanks for reaching out to us.

if you want to create a column, please try this,

Column = 
var _count=CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[ID]=EARLIER('Table'[ID]) && 'Table'[Period]<EARLIER('Table'[Period])))
return IF(ISBLANK(_count),0,_count)

vxiaotang_0-1666940773943.png

if you want to create a measure, please try this

measure = 
var _count=CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[ID]=MIN('Table'[ID]) && 'Table'[Period]<MIN('Table'[Period])))
return IF(ISBLANK(_count),0,_count)

vxiaotang_1-1666940837477.png

 

 

Best Regards,

Community Support Team _Tang

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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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