Forum Discussion

Fireoyster's avatar
Fireoyster
New Member
1 year ago
Solved

Table Query

Hello, New to Bi looks awesome. I am looking to find out how I can create a table listing the students and the number of times they have taken the class. any help would be appreciated.

 

Student IDNameCourseDate
S001Student 1Math 1012025-04-01
S001Student 1Math 1022025-04-03
S001Student 1Math 1032025-04-01
S002Student 2Welsh2025-04-03
S002Student 2American2025-04-03
S002Student 2English2025-04-01
S003Student 3Irish2025-04-03
S003Student 3French2025-04-01
S003Student 3German2025-04-03
S004Student 4Math 1012025-04-04
S004Student 4Math 1012025-04-05
S004Student 4Math 1092025-04-06

 

  • Hi Fireoyster,
    Thank you for reaching out to the Microsoft fabric community forum. 

    After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.    

    I am also including .pbix file for your better understanding, please have a look into it:

    If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

    Thank you for using Microsoft Community Forum.

6 Replies

  • Hi Fireoyster 

     

    Welcome and I'm sure you all enjoy the experience of the community and learning a lot as you go through this process with. regards to your question and what you're looking for is to create a dax measure which will count the number of students. There is a sample below. How do you create this based on your example above?

     

    Course Count = DISTINCTCOUNT('TableName'[Course])

     

    Put this measure into a table, then drag in the Name to get a count of how many courses the student took.

  • v-kpoloju-msft's avatar
    v-kpoloju-msft
    Community Support

    Hi Fireoyster,
    Thank you for reaching out to the Microsoft fabric community forum. 

    After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.    

    I am also including .pbix file for your better understanding, please have a look into it:

    If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

    Thank you for using Microsoft Community Forum.

    • v-kpoloju-msft's avatar
      v-kpoloju-msft
      Community Support

      Hi Fireoyster,

       

      May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

       

      Thank you.

      • v-kpoloju-msft's avatar
        v-kpoloju-msft
        Community Support

        Hi Fireoyster,


        I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


        Thank you.

  • Hi Fireoyster 


    Welcome to Power BI. Glad you're enjoying it so far! To create a table that lists each student and the number of times they’ve taken a class, you can easily do this using the visual and aggregation features. Simply load your data into Power BI, then create a Table visual.

     

    Drag the Student ID and Name fields into the table, and then drag the Course field into the values area and set it to "Count" (this will count how many courses each student has taken). This count will show the number of rows (i.e., class attendances) per student. If you want a DAX measure instead, you can create one like this:

    ClassCount = COUNTROWS('YourTableName')