cancel
Showing results for
Did you mean:
Frequent Visitor

## How to calculate sessions per day

I'm trying to calculate the number of sessions in my data. Sessions = a unique combination of Day + Cluster + User.

My data resembles this:

 Date Cluster User Nov 1 111 AAA Nov 2 222 AAA Nov 2 333 BBB Nov 2 333 BBB Nov 3 444 CCC Nov 3 333 AAA

In the above example, I want a calculation that results in this:

• Nov 1 = 1 session
• Nov 2 = 2 sessions
• There are 3 rows however 2 of the rows have the same cluster+user so they only count once
• Nov 3 = 2 sessions

Ultimately, I want to know how many sessions per day, which I'd show in a table or chart.

Any help is appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
New Contributor

## Re: How to calculate sessions per day

Hi @rlongden ,

You may create a calculated column to concatenate those fields if you have other fields in your table:

``````UniqueID =
Table[Date] & Table[Cluster] & Table[User]``````

Then create a measure to count the distinct values:

``````Unique Count =
DISTINCTCOUNT ( Table[UniqueID] )``````

"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
3 REPLIES 3
Super User

## Re: How to calculate sessions per day

Hi,

Drag Date to the Table visual.  This measure works

``Measure = COUNTROWS(DISTINCT(Data))``

Regards,
Ashish Mathur
http://www.ashishmathur.com
New Contributor

## Re: How to calculate sessions per day

Hi @rlongden ,

You may create a calculated column to concatenate those fields if you have other fields in your table:

``````UniqueID =
Table[Date] & Table[Cluster] & Table[User]``````

Then create a measure to count the distinct values:

``````Unique Count =
DISTINCTCOUNT ( Table[UniqueID] )``````

"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Frequent Visitor

## Re: How to calculate sessions per day

Thanks to both of you. This gives me what I need. To danextian, you guessed right that my actual data has some other columns that I didn't want in the calculation. I was able to use your example to get it working.

Announcements

#### Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

#### Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

#### Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)