Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
I am still at a early stage of learning Power Bi and I need help.
I am trying to create a table to get the total number of lessons attended by students. In below dataset I added 5 lessons and the date studdent attended that lesson. I want the total lessons attended at the last coulmn as displayed.
Please help and let me know how to get the count horizontally. Thanks in advance. 🙂
Solved! Go to Solution.
@axarhaan
If you must, here you go.
In Power Query, I pivoted the lessons and then in other table I grouped the count and merge it back.
But this is not how you should use Power BI, this would be way easier in Excel.
Hi, @axarhaan ,
this exact view is only possible if you go against the natural law of Power BI. Which I don't recommend.
The problem with this view is that this alone with the count is okey:
But if you want to add the Count, it automatically builds hierarchy:
With total ON:
So, if you keep data in the correct form as is here (souce):
Record ID | Lesson ID | Date |
1 | Lesson 1 | 16.06.2022 |
1 | Lesson 2 | 10.06.2022 |
3 | Lesson 1 | 15.01.2022 |
3 | Lesson 2 | 22.01.2022 |
3 | Lesson 3 | 29.01.2022 |
4 | Lesson 1 | 19.05.2022 |
4 | Lesson 2 | 16.06.2022 |
4 | Lesson 3 | 17.06.2022 |
5 | Lesson 2 | 16.06.2022 |
5 | Lesson 3 | 17.06.2022 |
5 | Lesson 4 | 23.06.2022 |
5 | Lesson 5 | 25.06.2022 |
You have to create an additional table for the count:
Thank you for your reply.
Keeping the data in a certain form is not in my hand. The picture I attached previously is the data format I am getting, so don't know how to build it like you suggested. And also I don't know how you are getting that Attending column says "1".
If any other solution, please share. Thank you so much.
@axarhaan
If you must, here you go.
In Power Query, I pivoted the lessons and then in other table I grouped the count and merge it back.
But this is not how you should use Power BI, this would be way easier in Excel.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |