Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have been trying this for a long time, but I haven't been able to do this. please help me with this.
Requirement: I have to show agents today's first break period in a Card visual.
Tables in Dataset - Activeagents, Verint table.
Relationship: Activeagents to Verint Table (1 to Many).
Condition - The page has an Employee Name slicer, for the selected employee name, based on shift date filter today's date and filter Break, then based on activity start time first minium value to show the Activity timesbetween(result is like 04:00 PM - 04:15 PM IST)
Here is the sample data of single employee : https://docs.google.com/spreadsheets/d/17wFnZqJb6fDiMZcek_L3k0EipAGssLYRgpGKKMXeXRs/edit?usp=sharing
(I want the value which is highlighted in Yellow and Red in Card visual)
Here is the DAX code which I am using =
Appreciate your help.
Solved! Go to Solution.
@Sri_phani Try this. PBIX is attached below signature.
Measure =
VAR __Emp = MAX('Table'[Employee Name as per IROZ])
VAR __Table = FILTER( 'Table', [Extracted Activity Name] = "Break_Unpaid" )
VAR __MaxBreakStart = MAXX( __Table, [Activity start IST/EET] )
VAR __MaxBreakEnd = MAXX( FILTER( 'Table', [Activity start IST/EET] = __MaxBreakStart ), [Activity end IST/EET] )
VAR __BreakStartTime = __MaxBreakStart - TRUNC( __MaxBreakStart )
VAR __BreakEndTime = __MaxBreakEnd - TRUNC( __MaxBreakEnd )
VAR __Result = FORMAT(__BreakStartTime, "Medium time" ) & " - " & FORMAT( __MaxBreakEnd, "Medium time" )
RETURN
__Result
hi @Sri_phani ,
as per the data available in the mentioned link the minimum time for break on 26th Jul should be 12.45 PM.
After considering this, if I proceed then I have done the following steps
Filter the table with respect to Break_Unpaid
Calculating first break
Please check visualization
Now if you need the yellow/red highlighted time as first break then either max function or distinctcount function (if there are more than 2 break periods available for an employee per day) needs to be used.
Using max function
Using Distinctcount function
Visualization can be done in the similar way.
If this solves your problem then accept the same as your solution.
hi @Sri_phani ,
as per the data available in the mentioned link the minimum time for break on 26th Jul should be 12.45 PM.
After considering this, if I proceed then I have done the following steps
Filter the table with respect to Break_Unpaid
Calculating first break
Please check visualization
Now if you need the yellow/red highlighted time as first break then either max function or distinctcount function (if there are more than 2 break periods available for an employee per day) needs to be used.
Using max function
Using Distinctcount function
Visualization can be done in the similar way.
If this solves your problem then accept the same as your solution.
You solution as well worked for me. Thank you Rakesh.!
@Sri_phani if it works then it is requested you to accept the same as solution. It will be helpful for me too.
@Sri_phani Try this. PBIX is attached below signature.
Measure =
VAR __Emp = MAX('Table'[Employee Name as per IROZ])
VAR __Table = FILTER( 'Table', [Extracted Activity Name] = "Break_Unpaid" )
VAR __MaxBreakStart = MAXX( __Table, [Activity start IST/EET] )
VAR __MaxBreakEnd = MAXX( FILTER( 'Table', [Activity start IST/EET] = __MaxBreakStart ), [Activity end IST/EET] )
VAR __BreakStartTime = __MaxBreakStart - TRUNC( __MaxBreakStart )
VAR __BreakEndTime = __MaxBreakEnd - TRUNC( __MaxBreakEnd )
VAR __Result = FORMAT(__BreakStartTime, "Medium time" ) & " - " & FORMAT( __MaxBreakEnd, "Medium time" )
RETURN
__Result
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
25 | |
12 | |
11 | |
10 | |
6 |