Forum Discussion

saranp780's avatar
saranp780
Helper III
7 years ago
Solved

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.

 

DateTimeUsernameTransaction
01.07.20199:53:07APayment
01.07.20199:53:07APayment
02.07.201910:25:28APayment
02.07.201910:25:46APURCHASE
02.07.201915:46:52APURCHASE
03.07.201910:51:01BPURCHASE
03.07.201910:51:01BPURCHASE
03.07.201910:51:01BPURCHASE
03.07.201911:01:01BPayment

 

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.

 

UsernameTransactionTime
APayment2
APURCHASE2
BPayment1
BPayment1

 

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

  • 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-msft's avatar
    v-chuncz-msft
    Community Support

    saranp780 

     

    You may add the measure below.

    Measure =
    COUNTROWS ( SUMMARIZE ( 'Table', 'Table'[Date], 'Table'[Time] ) )