Forum Discussion
Count Date Value Horizontally
- 3 years ago
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.
- vojtechsima3 years agoSuper User
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.