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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AGonza123
Frequent Visitor

DAX FORMULA

Hola a todos, tengo el siguiente problema, estaria necesitando crear rangos de horarios es decir, clasificar a un numero de personas por la empresa y la hora en que llegan, como una condicional de decir, si una persona corresponde a la empresa x y su hora de llegada es igual a la de entrada (08:15) entonces me de como resultado que cumpla, sin embargo si su llegada es mayor o igual a las 09:40, me de como resultado que tiene un atraso y si es mayor a 10:30, no cumple! en sintesis seria poner una condicion mezclando el nombre de la empresa con las horas, es posible eso? 

1 REPLY 1
negi007
Community Champion
Community Champion

@AGonza123  here is the solution you can use in this case

 

1. First create a base table which will have upper limit for each company employees to enter the office

 

negi007_0-1621261163072.png

 

2. second table would be your transactional table that will have daily employee coming to office time.

 

negi007_1-1621261203221.png

 

3. In the second table, i have used one calculated column that will determine if employee was on time or late within limits or late outside limits.

 

Status =
var first_St = LOOKUPVALUE (Base_Table [Expected_Arrival_Time], Base_Table [Company Name], Daily_Transaction [Company Name])
var second_St = LOOKUPVALUE (Base_Table [Expected_Arrival_Time_2], Base_Table [Company Name], Daily_Transaction [Company Name])
var act_time = Daily_Transaction [Actual_Arrival_Time]
return
if (act_time <= first_St, "On time",
if (act_time <= second_St, "Late within limits",
"Late outside limits"))
 
i have also sharing pbix file for your reference. this can help you
 
Do let me know if you able to do it. thanks
 



Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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