The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi All,
I am facing an issue in PowerBI matrix visualization.I have a school table with column values Student_ID,Location and AttendanceDate.
I need to find the sum of the number of times each student who attended classes >=1 days per location per month.
I have created a custom measure named Attendance as stated below to calculate students who the attended classes >=1
Attendance | StudentID | Location |
01.01.2017 | 100 | Delhi |
02.01.2017 | 100 | Delhi |
03.01.2017 | 100 | Delhi |
04.01.2017 | 100 | Delhi |
05.01.2017 | 100 | Delhi |
06.01.2017 | 100 | Delhi |
01.01.2017 | 101 | Delhi |
02.01.2017 | 101 | Delhi |
03.01.2017 | 101 | Delhi |
04.01.2017 | 101 | Delhi |
05.01.2017 | 101 | Delhi |
06.01.2017 | 101 | Delhi |
08.01.2017 | 101 | Delhi |
09.01.2017 | 102 | Chennai |
01.01.2017 | 102 | Chennai |
02.01.2017 | 102 | Chennai |
03.01.2017 | 102 | Chennai |
04.01.2017 | 102 | Chennai |
05.01.2017 | 102 | Chennai |
06.01.2017 | 102 | Chennai |
08.01.2017 | 102 | Chennai |
11.01.2017 | 102 | Chennai |
01.02.2017 | 101 | Delhi |
02.02.2017 | 101 | Delhi |
03.02.2017 | 101 | Delhi |
04.02.2017 | 101 | Delhi |
05.02.2017 | 101 | Delhi |
06.02.2017 | 101 | Delhi |
01.02.2017 | 100 | Delhi |
02.02.2017 | 100 | Delhi |
03.02.2017 | 100 | Delhi |
04.02.2017 | 100 | Delhi |
05.02.2017 | 100 | Delhi |
06.02.2017 | 100 | Delhi |
01.02.2017 | 102 | Chennai |
02.02.2017 | 102 | Chennai |
03.02.2017 | 102 | Chennai |
04.02.2017 | 102 | Chennai |
05.02.2017 | 102 | Chennai |
06.02.2017 | 102 | Chennai |
01.02.2017 | 103 | Goa |
02.02.2017 | 103 | Goa |
03.02.2017 | 103 | Goa |
04.02.2017 | 103 | Goa |
05.02.2017 | 103 | Goa |
06.02.2017 | 103 | Goa |
01.02.2017 | 104 | Goa |
02.02.2017 | 104 | Goa |
03.02.2017 | 104 | Goa |
04.02.2017 | 104 | Goa |
01.03.2017 | 100 | Delhi |
02.03.2017 | 100 | Delhi |
03.03.2017 | 100 | Delhi |
04.03.2017 | 100 | Delhi |
05.03.2017 | 100 | Delhi |
06.03.2017 | 100 | Delhi |
01.03.2017 | 101 | Delhi |
02.03.2017 | 101 | Delhi |
03.03.2017 | 101 | Delhi |
04.03.2017 | 101 | Delhi |
05.03.2017 | 101 | Delhi |
06.03.2017 | 101 | Delhi |
08.03.2017 | 101 | Delhi |
09.03.2017 | 102 | Chennai |
01.03.2017 | 102 | Chennai |
02.03.2017 | 102 | Chennai |
03.03.2017 | 102 | Chennai |
04.03.2017 | 102 | Chennai |
05.03.2017 | 102 | Chennai |
Solved! Go to Solution.
Hi, @deb_power123
According to your description, It's not hard to do. You can use 'DISTINCTCOUNT' in ID column instead of date column.
Like this:
Measure 2 = DISTINCTCOUNT(TableA[StudentID])
If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @deb_power123
According to your description, It's not hard to do. You can use 'DISTINCTCOUNT' in ID column instead of date column.
Like this:
Measure 2 = DISTINCTCOUNT(TableA[StudentID])
If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@deb_power123 , Try one of the measure
countx(values(Table[Location]), calculate(distinctCOUNT(Table[StudentID])))
or
countx(summarize(Table, Table[Location], Table[Date].Month, "_1",calculate(distinctCOUNT(Table[StudentID]))),[_1])
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
97 | |
80 | |
62 | |
57 |
User | Count |
---|---|
261 | |
120 | |
113 | |
83 | |
71 |