Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
I have the following table:
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:
Solved! Go to 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")
use below measure for visual filter
slicer =
IF(
[Measure]=SELECTEDVALUE('status'[Value]),
1,
IF(SELECTEDVALUE('status'[Value])=BLANK(),1,0))
make a table of 'status'
status = {("lastOnline"),("No")}
you can download file from below
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
Next up is how to filter using meaure
Create a table2
Table 2 =
SUMMARIZE(
'Table',
'Table'[Time],
"Type",'Table'[LastOnline]
)
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"
Final output
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:
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")
use below measure for visual filter
slicer =
IF(
[Measure]=SELECTEDVALUE('status'[Value]),
1,
IF(SELECTEDVALUE('status'[Value])=BLANK(),1,0))
make a table of 'status'
status = {("lastOnline"),("No")}
you can download file from below
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