Forum Discussion
How to count value that is only different?
Hi everyone, I am a new Power BI user. I have a requirement. Please suggest to me how to let a measure work.
| Date | Time | Username | Transaction |
| 01.07.2019 | 9:53:07 | A | Payment |
| 01.07.2019 | 9:53:07 | A | Payment |
| 02.07.2019 | 10:25:28 | A | Payment |
| 02.07.2019 | 10:25:46 | A | PURCHASE |
| 02.07.2019 | 15:46:52 | A | PURCHASE |
| 03.07.2019 | 10:51:01 | B | PURCHASE |
| 03.07.2019 | 10:51:01 | B | PURCHASE |
| 03.07.2019 | 10:51:01 | B | PURCHASE |
| 03.07.2019 | 11:01:01 | B | Payment |
I have one set of data like this table. What I want to do is to count the transaction that each people access but when I export the data from the system something that I don't want to use is also export too.
I want the measure that shows the result like this.
| Username | Transaction | Time |
| A | Payment | 2 |
| A | PURCHASE | 2 |
| B | Payment | 1 |
| B | Payment | 1 |
The same data count only 1 time. In my sample, user A accesses Payment transaction 2 times at 9:53:07 so count just 1.
Please suggest the measure or something that I have to do. Thank you.
You should be able to do this by creating a measure that uses the DISTINCTCOUNT function on the time column.
eg.
= DISTINCTCOUNT( Table[Time] )
2 Replies
- d_gosbellSuper User
You should be able to do this by creating a measure that uses the DISTINCTCOUNT function on the time column.
eg.
= DISTINCTCOUNT( Table[Time] )
- v-chuncz-msftCommunity Support
You may add the measure below.
Measure = COUNTROWS ( SUMMARIZE ( 'Table', 'Table'[Date], 'Table'[Time] ) )