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.
Hello,
I am trying to calculate the consecutive absent count of students......like they should be absent for 7 days continuously then the dax should take the count as 1 and if another student is asbsent for continuous 7 days then, dax should increase its count to 2. I have attached the above picture for reference. Consider Dates are stacked in one single column, in the above picture i divided the date into columns for easy understanding.
Help me to create a measure/ calculated column.
https://drive.google.com/file/d/1ul3CV3LSPBy5gk8tfmDtrunqCu-eKOsj/view?usp=drive_link
The .Pbix is in the above url
Hi @v-jianboli-msft ,
Thank you for your help,
But my data seems to be big, i am getting the below error after implementing your measure.
Could you please help me with this?
Hi @YogeshS ,
Please try:
Measure =
VAR _a =
COUNTX ( FILTER ( 'Table', [Value] = 0 ), [Date] )
VAR _b =
CALCULATE (
DISTINCTCOUNT ( 'Table'[ID] ),
FILTER (
FILTER ( ALL ( 'Table' ), [ID] <= MAX ( 'Table'[ID] ) ),
COUNTX (
FILTER ( ALL ( 'Table' ), [ID] = EARLIER ( 'Table'[ID] ) && [Value] = 0 ),
[Date]
) = 7
)
)
RETURN
IF ( _a = 7, _b )
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |