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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
davidi4524
Helper III
Helper III

counting records per user

hi, i have a table that contain the fo,owing colums:

 

name           date

jonthan       19/11/2017

jonthan       20/11/2017

josef             20/11/2017

omar             20/11/2017

jonthan          20/11/2017

josef               19/11/2017

 

i whant to create a related table that show the folowing information when i select the dates between 19/11/2017 and 20/11/2017

 

name      total days

jonthan       3

josef            2 

omar            1 

 

what is the correct syntax to create  a calculate column ??

 

thanks.

2 ACCEPTED SOLUTIONS

Hi @davidi4524,

 

Look at your original question carefully - COUNT is exactly what you wanted.  Anyways, for your changed question now, try this

 

=DISTINCTCOUNT(Data[Date])


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

View solution in original post

Anonymous
Not applicable

If you want a distinct count for my solution, simply select 'Distinct Count' from the dropdown instead of 'Count'.

 

 

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

If you want simply display the table, you can do that with just a couple clicks using the Table visual. Just drag the 'Name' column onto the table twice. Click the drop down arrow and select 'Count'. Then, create a filter using your Date column. Be sure that it's formatted as a date or date/time or you won't see the slider, you'll see check boxes.

 

 

If you want to create a brand new table...

  1. Enter the Query Editor
  2. Right-click the table and select 'Duplicate'
  3. With the new table selected, click 'Group By' from the 'Transform' section of the home ribbon
  4. Choose to group by your Name column
  5. Choose the Operation 'Count Rows'
  6. Click 'OK'

ok but i need to count distinct the numbers of the records per the username between dates. this solusion is only make a subtotal per username

Anonymous
Not applicable

If you want a distinct count for my solution, simply select 'Distinct Count' from the dropdown instead of 'Count'.

 

 

ok but i need to count distinct the numbers of the records per the username between dates. this solusion is only make a subtotal per username

Hi @davidi4524,

 

Look at your original question carefully - COUNT is exactly what you wanted.  Anyways, for your changed question now, try this

 

=DISTINCTCOUNT(Data[Date])


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

Hi,

 

This should not be a calculated column but a measure.  Drag the Name, create a date slicer  and make any selection.  Then use this measure

 

=COUNTROWS(Data)

 

Hope this helps.


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

sorry, i'm new to the dax language.  what execly the syntax to make it?

Hi @davidi4524,

 

Have you tried the solution provided above? Does it work in your scenario? If it works, could you accept it as solution to close this thread?

 

If you still have any question on this issue, feel free to post here. Smiley Happy

 

Regards

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.