Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
rlongden
New Member

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:

DateClusterUser
Nov 1111AAA
Nov 2222AAA
Nov 2333BBB
Nov 2333BBB
Nov 3444CCC
Nov 3333AAA

 

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
danextian
Super User
Super User

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] )

 

 

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

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] )

 

 

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.

Ashish_Mathur
Super User
Super User

Hi,

Drag Date to the Table visual.  This measure works

Measure = COUNTROWS(DISTINCT(Data))

Untitled.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors