Forum Discussion
Identify simultaneous occurrences at locations
- Anonymous2 years ago
Hi,Anonymous
I am glad to help you !
You are trying to manage multiple machines in multiple directories and you want to see the percentage of machines that are being occupied at various times of the day for the last week.
Here's what I'm trying to do, hopefully it will give you some help.
This is my test data:
This is the initial data, which contains some custom calculated columns and measures.Below are the measures and calculated columns (partially) created in the table:
Calculated Columns:
StartHour = HOUR('use_info'[Session Start time])EndHour = HOUR('use_info'[Session End time])In order to be able to calculate the time of day (24 hours), it is necessary to create a time table Hours
You need to create a corresponding table weekdays with all the weeks in it.
The following steps for implementation:
Create the relationship:
Create measure M_2 to calculate the number of machines that are executing at each time of day
M_2 = CALCULATE( DISTINCTCOUNT('use_info'[Machine]), FILTER('use_info',NOT ('use_info'[StartHour]>SELECTEDVALUE(Hours[hourName])||'use_info'[EndHour]<SELECTEDVALUE(Hours[hourName]))) )Then create a measure Machine_count to calculate the total number of machines in each group (grouped by location)
Machine_count = CALCULATE( DISTINCTCOUNT('use_info'[Machine]),FILTER(ALLSELECTED('use_info'),'use_info'[Location]=MAX('use_info'[Location])) )Finally create a measure M_result that calculates the percentage of the number of machines running
(here the DIVIDE function is used for division to avoid errors)M_result = DIVIDE([M_2],[Machine_count])The following puts all the parameters that need to be used into a matrix
The weekdayName and hourName fields need to be selected to "Show items with no data"
Add a slicer (you can add a date slicer on top of this to filter the data for the most recent week according to your needs)
Data used by the slicer: (inside the table used is the number of all the locations)Now you can see the number of machines running in different locations at different times of the day and the percentage of total machines by selecting the slicer's location.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,Anonymous
I am glad to help you !
You are trying to manage multiple machines in multiple directories and you want to see the percentage of machines that are being occupied at various times of the day for the last week.
Here's what I'm trying to do, hopefully it will give you some help.
This is my test data:
This is the initial data, which contains some custom calculated columns and measures.
Below are the measures and calculated columns (partially) created in the table:
Calculated Columns:
StartHour =
HOUR('use_info'[Session Start time])
EndHour =
HOUR('use_info'[Session End time])
In order to be able to calculate the time of day (24 hours), it is necessary to create a time table Hours
You need to create a corresponding table weekdays with all the weeks in it.
The following steps for implementation:
Create the relationship:
Create measure M_2 to calculate the number of machines that are executing at each time of day
M_2 =
CALCULATE(
DISTINCTCOUNT('use_info'[Machine]),
FILTER('use_info',NOT ('use_info'[StartHour]>SELECTEDVALUE(Hours[hourName])||'use_info'[EndHour]<SELECTEDVALUE(Hours[hourName])))
)
Then create a measure Machine_count to calculate the total number of machines in each group (grouped by location)
Machine_count = CALCULATE(
DISTINCTCOUNT('use_info'[Machine]),FILTER(ALLSELECTED('use_info'),'use_info'[Location]=MAX('use_info'[Location]))
)
Finally create a measure M_result that calculates the percentage of the number of machines running
(here the DIVIDE function is used for division to avoid errors)
M_result = DIVIDE([M_2],[Machine_count])
The following puts all the parameters that need to be used into a matrix
The weekdayName and hourName fields need to be selected to "Show items with no data"
Add a slicer (you can add a date slicer on top of this to filter the data for the most recent week according to your needs)
Data used by the slicer: (inside the table used is the number of all the locations)
Now you can see the number of machines running in different locations at different times of the day and the percentage of total machines by selecting the slicer's location.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.