Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
newtonian1991
Frequent Visitor

Custom measure to show how many times student appears in list based on filter and slicer

Hi All, 

have had several atytempts at this and cant get it working wiht sum, sumx and count row functions.

 

I have the following information and would like a custom measure to calculate the total times a student shows up in the table where title = "Late Arrival" this data gets filtered by a between date slicer. I then need this value to appear next to every occurance in the list. In this exampel it would be a total count of 2 showing up on each line. 

 

As well as that i would then like to create display a tabel that shows the number of students with 0-2 lates 3-5 lates 6-8 lates etc. 

 

Title

StudentIDYear GroupFormDate/TimeReasonEarly Departure Count
Late Arrival134336Year 1111MOO16/5/2023 14:26Senior Pass Tag Out1
Late Arrival134336Year 1111MOO13/6/2023 14:27Senior Pass Tag Out1

 

Any help would be greatly appreciated. 

6 REPLIES 6
newtonian1991
Frequent Visitor

almost go there with the below dax but the column value doesnt change when i change the slicer. 

Late Arrivals Count = 
VAR SelectedStartDate = MIN('Late Arrival And Early Departure'[LocalTimeCombined])  // Replace with the actual slicer field
VAR SelectedEndDate = MAX('Late Arrival And Early Departure'[LocalTimeCombined])      // Replace with the actual slicer field
RETURN
    CALCULATE(
        COUNTROWS('Late Arrival And Early Departure'),
        FILTER(
            'Late Arrival And Early Departure',
            'Late Arrival And Early Departure'[PupilID] = EARLIER('Late Arrival And Early Departure'[PupilID]) &&
            'Late Arrival And Early Departure'[Title] = "Late Arrival" &&
            'Late Arrival And Early Departure'[CheckInLocalTime] >= SelectedStartDate &&
            'Late Arrival And Early Departure'[CheckInLocalTime] <= SelectedEndDate
        )
    )
Ashish_Mathur
Super User
Super User

Hi,

Share a dataset with more rows.  What is the use of the time stamp in the Date/Time column?  Also, would you be OK with a measure only solution (no calculated column)?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Yes, anythign that gets me the result really.

 

as im a new user it seems as though i cnat attach data. please see below. 

 

TitleStudentIDYear GroupFormDate/TimeReasonCount
Early Departure3309504Year 1111MOO6/6/2023 14:23Senior Pass Tag Out1
Early Departure3309504Year 1111MOO18/7/2023 14:23Senior Pass Tag Out1
Early Departure3309504Year 1111MOO1/8/2023 14:27Senior Pass Tag Out1
Early Departure3309504Year 1111MOO15/8/2023 14:30Senior Pass Tag Out1
Early Departure3309504Year 1111MOO12/9/2023 14:59Senior Pass Tag Out1
Early Departure3309504Year 1111MOO15/9/2023 14:26Senior Pass Tag Out1
Early Departure3309504Year 1111MOO10/10/2023 13:26Senior Pass Tag Out1
Early Departure3309504Year 1111MOO13/10/2023 13:24Senior Pass Tag Out1
Early Departure3309504Year 1111MOO24/10/2023 13:46Senior Pass Tag Out1
Early Departure3309504Year 1111MOO6/11/2023 13:24Senior Pass Tag Out1
Late Arrival3309504Year 1111MOO11/7/2023 11:16Other Reasons1
Late Arrival3309504Year 1111MOO20/10/2023 10:01Senior Pass Tag In1
Late Arrival3309504Year 1111MOO3/11/2023 9:56Senior Pass Tag In1
Early Departure333302833Year 1111LEA19/6/2023 14:33Medical Appointment1
Early Departure333302833Year 1111LEA20/7/2023 14:29Medical Appointment1
Early Departure333302833Year 1111LEA7/8/2023 14:29Senior Pass Tag Out1
Early Departure333302833Year 1111LEA18/8/2023 14:22Senior Pass Tag Out1
Early Departure333302833Year 1111LEA15/9/2023 14:29Senior Pass Tag Out1
Early Departure333302833Year 1111LEA13/10/2023 14:04Senior Pass Tag Out1
Early Departure333302833Year 1111LEA16/10/2023 13:35Senior Pass Tag Out1
Early Departure333302833Year 1111LEA19/10/2023 8:51Medical Appointment1
Early Departure333302833Year 1111LEA24/10/2023 14:34Medical Appointment1
Early Departure333302833Year 1111LEA27/10/2023 13:28Senior Pass Tag Out1
Early Departure333302833Year 1111LEA6/11/2023 13:12Medical Appointment1
Late Arrival333302833Year 1111LEA1/8/2023 10:08Senior Pass Tag In1
Late Arrival333302833Year 1111LEA15/8/2023 9:59Senior Pass Tag In1
Late Arrival333302833Year 1111LEA10/10/2023 8:16Senior Pass Tag In1
Late Arrival333302833Year 1111LEA19/10/2023 9:45Medical Appointment1
Late Arrival333302833Year 1111LEA3/11/2023 9:43Senior Pass Tag In1
Late Arrival333302833Year 1111LEA6/11/2023 8:51Senior Pass Tag In1
Late Arrival333302833Year 1111LEA6/11/2023 14:06Medical Appointment1

Hi,

PBI file attached.

Ashish_Mathur_0-1699328582481.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

newtonian1991_0-1699329421441.png

Thank you, almost there. I was hoping the circled column in red would show the total number of lates rather thna just 1 when placed in a column so i can sort students with most lates. 

 

i woudl also liek to eb able to filter or cross filter by the categories you ahve created. for e.g circled in green, select 3-5 lates and table updates only to show me students with 3-5 lates. 

 

Thansk again for your help. 

You are welcome.  This file should help.

Ashish_Mathur_0-1699336209496.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.