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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
James_CA
Frequent Visitor

IOT Device Status (Data look up by ID)

Hi, I am new in PowerBI. I want to monitor some of my IoT Device by PowerBI Dashboard But I am unable to create the formula to DeviceID lookup on the date and create a new table

 

My Devices are generating this report  

IOTDevice Reporting.JPG

 

 

This is the list of all device

All Device ID.JPG

 

 

Device Status.JPG

I want to create a similar DeviceStatus table on PowerBI but I am unable to find any formula Can anyone tell me how can I do it? Which function should I use? It will be a great help, Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @James_CA 

You need to build a calculated table ,add a calculated column and use measure to achieve your goal.

I build a table like yours to have a test.

Table (Add a calculated column and format the Data type as Date):

Date = 'Table'[Datetime]-TIMEVALUE('Table'[Datetime])

1.png

AllDeviceID:

2.png

Build a Date Table:

Date = 
GENERATE (
    CALENDAR ( DATE ( 2020, 09, 01 ), DATE ( 2020, 09, 04 ) ),
    AllDeviceID
)

 Measure:

Measure = 
VAR _Datevalue =
    CALCULATETABLE (
        VALUES ( 'Table'[DeviceID] ),
        FILTER (  'Table' , 'Table'[Date] = MAX ( 'Date'[Date] ) )
    )
RETURN
    IF ( MAX ( 'Date'[DeviceID] ) IN _Datevalue, "True", "False" )

Build a matrix visual to see the result.

3.pngYou can download the pbix file from this link: IOT Device Status (Data look up by ID)

 

Best Regards,

Rico Zhou

 

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

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @James_CA 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

Anonymous
Not applicable

Hi @James_CA 

You need to build a calculated table ,add a calculated column and use measure to achieve your goal.

I build a table like yours to have a test.

Table (Add a calculated column and format the Data type as Date):

Date = 'Table'[Datetime]-TIMEVALUE('Table'[Datetime])

1.png

AllDeviceID:

2.png

Build a Date Table:

Date = 
GENERATE (
    CALENDAR ( DATE ( 2020, 09, 01 ), DATE ( 2020, 09, 04 ) ),
    AllDeviceID
)

 Measure:

Measure = 
VAR _Datevalue =
    CALCULATETABLE (
        VALUES ( 'Table'[DeviceID] ),
        FILTER (  'Table' , 'Table'[Date] = MAX ( 'Date'[Date] ) )
    )
RETURN
    IF ( MAX ( 'Date'[DeviceID] ) IN _Datevalue, "True", "False" )

Build a matrix visual to see the result.

3.pngYou can download the pbix file from this link: IOT Device Status (Data look up by ID)

 

Best Regards,

Rico Zhou

 

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

amitchandak
Super User
Super User

@James_CA ,

Create a date column //prefer

Date = [Datetime].date //Prefer way is join it with Date table

 

Count occurrence=Count(Table[Date]) // or Count(Table[Datetime])

 

if (isblank([Count occurrence]) , "False","True")

 

Use it in matrix with Device Id and date

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello,

 

I am new. Can you please explain a little more

 

Count occurrence=Count(Table[Date]) // or Count(Table[Datetime])

is giving me the total row count.

 

I am connecting two table by Date

Can anyone help please?

@amitchandak

Can you please show me an example?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors