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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
non23
Helper I
Helper I

Show latest date in table - show blank if possible

hey guys, I have a data that looks like below:
Screenshot 2024-06-16 181501.png

and I want to show the latest time-out date, but if it's blank then it should show blank instead of the other log-out time like below:
Screenshot 2024-06-16 181741.png

Appreciate any help! 

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic mode looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1718537758826.png

 

Jihwan_Kim_1-1718538261077.png

 

Earliest timein: = 
MINX (
    SUMMARIZE ( data, user[user], data[time_in] ),
    CALCULATE ( MIN ( data[time_in] ) )
)

 

Latest timeout: =
VAR _t =
    SUMMARIZE ( data, user[user], data[time_in] )
VAR _result =
    MAXX ( _t, CALCULATE ( MAX ( data[time_out] ) ) )
VAR _condition =
    COUNTROWS ( FILTER ( _t, CALCULATE ( MAX ( data[time_out] ) ) = BLANK () ) ) > 0
RETURN
    IF ( _condition, BLANK (), _result )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

Moetazzahran
Resolver II
Resolver II

Hello @non23 , 

If I understand correctly, you want the earliest timein and latest timeout per user in two different measures. 

 

Earliest TimeIn =
CALCULATE(
    MIN('Table'[TimeIn]),
    ALLEXCEPT('Table', 'Table'[User])
)

Latest TimeOut =
SWITCH(True(),
    ISBLANK( CALCULATE(
        MAX('Table'[TimeOut]),
        ALLEXCEPT('Table', 'Table'[User])
    )),
    BLANK(),
    VAR parallelvalue=CALCULATE(
        MAX('Table'[TimeIn]),
        ALLEXCEPT('Table', 'Table'[User])
    )
    RETURN
    CALCULATE(MAX('Table'[TimeOut]),ALLEXCEPT('Table', 'Table'[User]),'Table'[TimeIn]=parallelvalue)
)


Please let me know if this serves the purpose. And accept it as a solution if it solves your problem. 

You Kudos is much appreciated. 

Thank you

View solution in original post

2 REPLIES 2
Moetazzahran
Resolver II
Resolver II

Hello @non23 , 

If I understand correctly, you want the earliest timein and latest timeout per user in two different measures. 

 

Earliest TimeIn =
CALCULATE(
    MIN('Table'[TimeIn]),
    ALLEXCEPT('Table', 'Table'[User])
)

Latest TimeOut =
SWITCH(True(),
    ISBLANK( CALCULATE(
        MAX('Table'[TimeOut]),
        ALLEXCEPT('Table', 'Table'[User])
    )),
    BLANK(),
    VAR parallelvalue=CALCULATE(
        MAX('Table'[TimeIn]),
        ALLEXCEPT('Table', 'Table'[User])
    )
    RETURN
    CALCULATE(MAX('Table'[TimeOut]),ALLEXCEPT('Table', 'Table'[User]),'Table'[TimeIn]=parallelvalue)
)


Please let me know if this serves the purpose. And accept it as a solution if it solves your problem. 

You Kudos is much appreciated. 

Thank you
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic mode looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1718537758826.png

 

Jihwan_Kim_1-1718538261077.png

 

Earliest timein: = 
MINX (
    SUMMARIZE ( data, user[user], data[time_in] ),
    CALCULATE ( MIN ( data[time_in] ) )
)

 

Latest timeout: =
VAR _t =
    SUMMARIZE ( data, user[user], data[time_in] )
VAR _result =
    MAXX ( _t, CALCULATE ( MAX ( data[time_out] ) ) )
VAR _condition =
    COUNTROWS ( FILTER ( _t, CALCULATE ( MAX ( data[time_out] ) ) = BLANK () ) ) > 0
RETURN
    IF ( _condition, BLANK (), _result )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.