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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
shhirji
Microsoft Employee
Microsoft Employee

Use time based data to create new column measure

Hi, 

 

A brief intro to my data set. I am monitoring the health of several devices. A message is sent to the database every 5 mins if the device is working, if it is not, a message is not sent. 

 

In powerBI, I have 2 tables, 1 pulls in data from the past 30 days and the other pulls data from the past 1 hour. Based on the last hour message, I want to add a new column measure to table 1. I want to determined the value of this column based on this logic: if a message was seen from a device in the past 1 hour ( from table 2), then value of new column is healthy. If message was not seen from the device, I want to mark the last most instance of that device on table 1 as unhealthy -- sort of like a "last seen" concept, for when the nodes was last seen to be working. 

 

So far, when I tried to do this, if a device was unhealthy, the DAX would be marking ALL of the past entries of this device as unhealthy. However, to make my dashboard useful, I want to preserve historic data of the devices so I can observe the changes over the 30 day period per device. 

 

Another approach I tried, was to mark a device as healthy/unhealthy directly while pulling the past 1 hour data set from my DB, however, I was not able to use this table to mark the past 30 days table. Basically, I was hoping to implement this kind of logic: if device is marked unhealthy in past one hour, add "row" to past 30 days data, at time X and value in new column as unhealthy. Or another approach would be to mark its last most message as unhealthy, if adding a new row isn't possible

 

1 REPLY 1
Mariusz
Community Champion
Community Champion

Hi @shhirji 

 

Can you provide a sample of your tables + outcome + the relationship between the tables

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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