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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
stefan321
Helper I
Helper I

get last online Date

I have the following table:

stefan321_0-1712828288547.png

Like to have a measure where i get the last "Online" (see Status column) date (Column Time) from each Server.

For example in that way:

stefan321_1-1712828357243.png

 

1 ACCEPTED SOLUTION

hi, @stefan321 

 

try below measure

for lastonline

Measure = 
var a= MAXX(
          FILTER(
            ALL('Table'),
            'Table'[server]=MAX('Table'[server]) && 'Table'[status]="online"),
            'Table'[time]
        )
Return
If(min('table'[time])=a&& MIN('Table'[status])="online","lastonline","No")

Dangar332_0-1713026678150.png

 

 

 

use below measure for visual filter

slicer = 
IF(
    [Measure]=SELECTEDVALUE('status'[Value]),
    1,
    IF(SELECTEDVALUE('status'[Value])=BLANK(),1,0))

Dangar332_1-1713026810151.png

 

 

 

make a table of  'status'

status = {("lastOnline"),("No")}

 

 you can download file from below

 

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @stefan321 ,
Thanks for @Dangar332  reply.
Here's my alternative approach and additions
Create a meaure

LastOnline = 
VAR _MaxTime = 
CALCULATE(
    MAX('Table'[Time]),
    FILTER(
        ALLEXCEPT(
        'Table',
        'Table'[Server]
    ),
        'Table'[Status] = "Online"
    )
)
RETURN
IF(
    SELECTEDVALUE('Table'[Time]) = _MaxTime,
    "lastOnline",
    "No"
)

Output

vheqmsft_0-1712905733049.png

Next up is how to filter using meaure
Create a table2

Table 2 = 
SUMMARIZE(
    'Table',
    'Table'[Time],
    "Type",'Table'[LastOnline]
)

vheqmsft_1-1712905818535.png
Use type as slicer value
Create another meaure

Slicer = 
IF(
    'Table'[LastOnline] = SELECTEDVALUE('Table 2'[Type]),
    1,
    IF(
        SELECTEDVALUE('Table 2'[Type]) = BLANK(),
        1,
        0
    )
)

Use the meaure as filter of this visual and set it "is 1"

vheqmsft_2-1712905964176.png

Final output

vheqmsft_3-1712905982540.pngvheqmsft_4-1712905995676.png

vheqmsft_5-1712906014154.png

Best regards,

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

 



Hi Albert

ist works! thanks a ton! really a nice solution 🙂

i have just a small issue: Sometimes i have The same timestamp for a Server whith multiple Instances. So for example:

Screenshot 2024-04-12 145625.jpg

Unfortunately your solution shows in that case all Status entries, but i want to have Online only. Do you have a easy solution for that? Thanks

hi, @stefan321 

 

try below measure

for lastonline

Measure = 
var a= MAXX(
          FILTER(
            ALL('Table'),
            'Table'[server]=MAX('Table'[server]) && 'Table'[status]="online"),
            'Table'[time]
        )
Return
If(min('table'[time])=a&& MIN('Table'[status])="online","lastonline","No")

Dangar332_0-1713026678150.png

 

 

 

use below measure for visual filter

slicer = 
IF(
    [Measure]=SELECTEDVALUE('status'[Value]),
    1,
    IF(SELECTEDVALUE('status'[Value])=BLANK(),1,0))

Dangar332_1-1713026810151.png

 

 

 

make a table of  'status'

status = {("lastOnline"),("No")}

 

 you can download file from below

 

 

Dangar332
Super User
Super User

Hi, @stefan321 

Try below measure

Var a= 
Maxx(
 filter(all(table),
 table[server]=max(table[server]) && table[status]="online"),
 table[time]
)
Return
If(min(table[time])=a,"lastonline","No")

Fantastic! it works 

Thanks a lot 🙂

Now i have another question. How can i visual that measure with a slicer or checkbox? Want to easily swtich between "No" and "lastonline"
Thanks

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.