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

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.

Reply
Anonymous
Not applicable

Help! Measure to find the first value of the column with values from corresponding column.!

Hello All,

 

My data looks like this:

1.PNG

 

I need to find the first clock in time of each person(user_id) for each day.

I'm finding this to see if they are on time or not.

 

Thanks!

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

We can just put the field into table visual as following to meet your requirement:

 

13.PNG

We can also create a measure and put into the formula to get the same result:

 

MinValueMeasure
= MIN ( 'Table'[SCAN_DATE_TIME] )

 

Or we can create a calculated table using DAX formula:

 

 

Table 2 =
SUMMARIZECOLUMNS (
    'Table'[USER_ID],
    'Table'[SCAN_DATE_TIME].[Date],
    "FirstTime", CALCULATE ( MIN ( 'Table'[SCAN_DATE_TIME] ), 'Table'[SCAN_TYPE] = "IN" )
)

 

 

15.PNG

 

If the name value in your table is real data, we suggest you to blank it as soon as possible.

 


BTW, pbix as attached.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,


How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
saraMissBI
Resolver I
Resolver I

Hi @Anonymous 

I need to understand your question, please. Do you want to find the first person who arrived on each day? or do you want to find the first time of each user on each day (can one user have more than one time on one day?)

Anonymous
Not applicable

thanks for your reply.

Yes I need to find the first time for each person on each day to figure out if they are on time or not.

And yes a person can have multiple ins.

 

Thanks,

Anand

Hi @Anonymous ,

Try 

 

Measure =
CALCULATE (
    MAX ( Table[SCAN_DATE_TIME] ),
    FILTER ( ALLEXCEPT ( Table, USER_ID ), SCAN_TYPE = "IN" )
)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Thanks for your reply.

But your measure is not showing the first value for each day.

What I did was I made a separate date only column from the date time column and included that in the all except function.

 

Thanks again for your reply.

 

Hi @Anonymous ,

 

We can just put the field into table visual as following to meet your requirement:

 

13.PNG

We can also create a measure and put into the formula to get the same result:

 

MinValueMeasure
= MIN ( 'Table'[SCAN_DATE_TIME] )

 

Or we can create a calculated table using DAX formula:

 

 

Table 2 =
SUMMARIZECOLUMNS (
    'Table'[USER_ID],
    'Table'[SCAN_DATE_TIME].[Date],
    "FirstTime", CALCULATE ( MIN ( 'Table'[SCAN_DATE_TIME] ), 'Table'[SCAN_TYPE] = "IN" )
)

 

 

15.PNG

 

If the name value in your table is real data, we suggest you to blank it as soon as possible.

 


BTW, pbix as attached.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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