Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
i got a csv file with an id and transaction i need to count for each id how many transaction line there is
in this case for id 8 should be 5
an easy task but i can find out right now im stuck
count row same id
You can use something like this
Column =
Var new = Table1[id]
Var Count1 = CALCULATE(
COUNTROWS(Table1),
all(Table1),
Table1[id] = new
)
Return Count1
@Anonymous
Column =
Var new = transactions[CustomerID]
Var Count1 = CALCULATE(
COUNTROWS(transactions),
all(transactions),
transactions[CustomerID] = new
)
Return Count1))
name of table column : transactions[CustomerID]
I got an error
The syntax for ')' is incorrect. (DAX(Var new = transactions[CustomerID]Var Count1 = CALCULATE(COUNTROWS(transactions),all(transactions),transactions[CustomerID] = new)Return Count1)))).
Please make sure you have correct opening and closing brackets in your column definition.
I created the column and got no errors
Column =
Var new = Table1[ID]
Var Count1 = CALCULATE(
COUNTROWS(Table1),
all(Table1),
Table1[ID] = new
)
Return Count1
count =
Var new = transactions[CustomerID]
Var Count1 = CALCULATE(
COUNTROWS(transactions),
all(transactions),
transactions[CustomerID] = new
)
Return Count1
A single value for column 'CustomerID' in table 'transactions' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
@Anonymous
are you creating it as column or measure?
The example I gave is for creating a column and not a measure.
@Anonymous
I tried both but same error
Hi @snifer,
That's weird. Can you share some snapshots?
Please also try this one. It's a calculated column.
Column =
CALCULATE (
COUNT ( transactions[CustomerID] ),
ALLEXCEPT ( transactions, transactions[CustomerID] )
)
Best Regards,
Dale
The simplest way would be to create a measure like this
Measure = COUNTROWS(Table1)
On the report canvas, drag the id field and this measure onto a table visualization
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |