The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I am trying to counts students absent if they have skipped more than 8 bell periods on the same day. I was wondering if somebody could help me out here. I tried a distinct count with a counts of bell periods greater than 6 (that is the ballpark) but it is not working. I am providing a sample table below here.
Students ID | Bell Period | Date |
101 | 1 | 6/1/2020 |
101 | 2 | 6/1/2020 |
101 | 3 | 6/1/2020 |
101 | 4 | 6/1/2020 |
101 | 5 | 6/1/2020 |
101 | 6 | 6/1/2020 |
101 | 7 | 6/1/2020 |
101 | 8 | 6/1/2020 |
101 | 9 | 6/1/2020 |
103 | 1 | 6/1/2020 |
103 | 2 | 6/1/2020 |
103 | 3 | 6/1/2020 |
103 | 4 | 6/1/2020 |
103 | 5 | 6/1/2020 |
103 | 2 | 6/2/2020 |
Solved! Go to Solution.
You could try an expression like this:
More than 8 bells =
VAR summarytable =
ADDCOLUMNS (
SUMMARIZE ( Table, Table[Students], Table[PeriodDate] ),
"@BellsMissed", CALCULATE ( COUNTROWS ( Table ) )
)
RETURN
COUNTROWS ( FILTER ( summarytable, [@BellsMissed] > 8 ) )
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
You could try an expression like this:
More than 8 bells =
VAR summarytable =
ADDCOLUMNS (
SUMMARIZE ( Table, Table[Students], Table[PeriodDate] ),
"@BellsMissed", CALCULATE ( COUNTROWS ( Table ) )
)
RETURN
COUNTROWS ( FILTER ( summarytable, [@BellsMissed] > 8 ) )
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@syasmin25 - So what are we looking at? Is that your source data and does it represent periods skipped or periods attended? What is the expected output from the sample data set?
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
This is a sample that I created with periods that the students was marked absent.
User | Count |
---|---|
14 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
28 | |
18 | |
13 | |
7 | |
5 |