Forum Discussion
Anonymous
5 years agoNot applicable
Count changes per order and order line
Hi
I have data like this
| Order | Line | change type |
| abc | 1 | x |
| abc | 1 | t |
| abc | 2 | x |
| abc | 2 | t |
| bcd | 1 | x |
| bcd | 2 | x |
| bcd | 2 | x |
| bcd | 3 | x |
and I would like to acheive dax table like this
| Order | Line | # of changes |
| abc | 1 | 2 |
| abc | 2 | 2 |
| bcd | 1 | 1 |
| bcd | 2 | 2 |
| bcd | 3 | 1 |
or new column like this
| Order | Line | change type | # of changes |
| abc | 1 | x | 2 |
| abc | 1 | t | 2 |
| abc | 2 | x | 2 |
| abc | 2 | t | 2 |
| bcd | 1 | x | 1 |
| bcd | 2 | x | 2 |
| bcd | 2 | x | 2 |
| bcd | 3 | x | 1 |
Thank you very much for support
m
Anonymous , You can have a new measure like
Distinctcount(Table[change_type])
or a new column
countx(filter(Table, [Order] =earlier([Order]) ),[Line])
1 Reply
- amitchandak
Super User
Anonymous , You can have a new measure like
Distinctcount(Table[change_type])
or a new column
countx(filter(Table, [Order] =earlier([Order]) ),[Line])