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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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