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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
vickyprudhvi
Helper IV
Helper IV

Dax Calculated Column for Repeat Count

Hi,

ID          Amt                 CalculatedColumn

1           1000                           3

1           2000                           3

1           3000                           3

2           10                               2

2            20                              2

 

I want to creat a calculated column where it counts number of id's repeated and shows same value for all rows for that ID

(as showned in above table). Kindly let me know how to create calculatedColumn for this

 

Thank you

 

9 REPLIES 9
austinsense
Impactful Individual
Impactful Individual

Var CURRENTID = Table[ID]
Return calculate (countrows(Table), Table[ID] = CURRENTID)
Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

@austinsense

Is that a calculated column or where is that dax returned

Yep, calculated column
Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

@austinsense

do u mean this

CALCULATE(COUNTROWS(Table),Table[Id]=EARLIER(Table'[Id]))

I am not sure how to write VAR or return function in Tabular Model DAX

 

Either way, those two formulas produce the exact same result.
Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

@austinsense

Its not working with my formular it repeating total count of table instead of repeating total count for each ID

@austinsense btw I am using Tabular model 2012 and not 2016 so VAR anc Return function is not available

Yep, sorry we should have covered that Smiley Happy sounds like you got the problem solved?

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂
vickyprudhvi
Helper IV
Helper IV

@austinsense -Kindly help

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.