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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Group and compare values at each datetime on the same table

I have a database with equipament status and its correspondent control status. I need to check if at each DateTime both Status (Equipment and Control) for each Equipment are equal.

For example, on first and second rows we have equipment 1. So if Status for Eq1_Status and Ctrl_Eq1_Status are the same, the result is set to 1, otherwise it's set to 0. Is it possible use a measure? How can I do that?

Thank you!

DateTime                   Tag Id                    Status          Equipment Id      Tag Type                 
29/07/2022 12:00Eq1_Status1Equipment1Status Equipment
29/07/2022 12:00Ctrl_Eq1_Status1Equipment1Status Control
29/07/2022 12:00Eq2_Status0Equipment2Status Equipment
29/07/2022 12:00Ctrl_Eq2_Status1Equipment2Status Control
29/07/2022 12:05Eq1_Status1Equipment1Status Equipment
29/07/2022 12:05Ctrl_Eq1_Status1Equipment1Status Control
29/07/2022 12:05Eq2_Status0Equipment2Status Equipment
29/07/2022 12:05Ctrl_Eq2_Status1Equipment2Status Control
29/07/2022 12:10Eq1_Status1Equipment1Status Equipment
29/07/2022 12:10Ctrl_Eq1_Status1Equipment1Status Control
29/07/2022 12:10Eq2_Status0Equipment2Status Equipment
29/07/2022 12:10Ctrl_Eq2_Status1Equipment2Status Control
1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

I'm not sure if this is an option for your situation but this is much easier if you pivot the [Tag Type] column in the Query Editor so that the data looks like this:

AlexisOlson_0-1659151891470.png

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

I'm not sure if this is an option for your situation but this is much easier if you pivot the [Tag Type] column in the Query Editor so that the data looks like this:

AlexisOlson_0-1659151891470.png

Anonymous
Not applicable

Hi @AlexisOlson 

Could you please explain how you applied pivot?

I tried what is shown below but I didn't get the same result.

gasilva8_0-1659356742839.png

gasilva8_2-1659356855559.png

 

EDIT:

I just realized you deleted [Tag Id] column. So I deleted this column before pivoting [Tag Type] and it worked.

Thank you!

gasilva8_0-1659359630911.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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