Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello,
I have been trying to show whether the device is online/offline based on it's last response time. I have created a new column with logic as, if the device's last response is within 2 hours then it's online and everything else is offline.
Here i want to make the 2 hours window as dynamic, user can pick between 1-24 hours and the logic should be
if the device's last response is within <user selected> hours then it's online and everything else is offline.
I am able to get a measure working,
Hi @sharmisaranga09 ,
Does the above dax formula solve your problem, and if it doesn't meet your expected results, can you share sample data and sample output in tabular format? Or sample pbix after removing sensitive data. We can understand the problem better and help you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I couldn't attach pbix due to permission issue, Here is the sample I captured. DateTime is in UTC.
Hi, Thank you.
I have multiple devices with single devicelastresponsetime value each, this gets updated whenever new response receives.
I still get all the values as offline eventhough I have chosen higher parameter value from your pbix report.
were you able to get the changes for selected value from slicer or have you used default value in parameter configuration?
Hi @sharmisaranga09 ,
Here are the steps you can follow:
If you have more than one device, you can use the following dax.
Create measure
Group_date =
var _maxdate= MAXX(FILTER(ALL('device'),'device'[device_name]=MAX('device'[device_name])),[devicelastresponsetime])
var _hour=DATEDIFF(_maxdate,NOW(),HOUR)
return
IF(
_hour=SELECTEDVALUE('Parameter'[Parameter]),"Online","Offline")
If you have a device, you can use the following dax.
Create measure
Single_date =
var _maxdate= MAXX(ALL('device'),[devicelastresponsetime])
var _hour=DATEDIFF(_maxdate,NOW(),HOUR)
return
IF(
_hour=SELECTEDVALUE('Parameter'[Parameter]),"Online","Offline")
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 52 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 73 | |
| 70 | |
| 39 | |
| 34 | |
| 23 |