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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
AliRashed2024
New Member

Creating Timestamp and Visualization

Hi Everyone,
I an new on working on Power BI and I seek you help on urgent assignment. 


I have a project in Power BI, to visual Activity based on Time. There are certian Acitivties are not generated from the system which I must also inculde. 

the question is: I have an activities called "Customer Services" and the time give per day is 2 hours. since such activities will not occur in exact time during the day I would like to divide the 2 / 8 "Working Hours" so when I visualize it it show from 9 am to 5 pm.



The current Table I have as the following Columns:
Date
Activity

1 REPLY 1
v-zhouwen-msft
Community Support
Community Support

Hi @AliRashed2024 ,

I have assumed some data, 'Table' surface system-generated data and 'Table2' represents activities that do not exist in the system.

vzhouwenmsft_4-1716361825140.png

vzhouwenmsft_5-1716361856681.png

 

Please follow these steps:

1.Appending Two Tables Together Using Power Query

vzhouwenmsft_6-1716361901820.png

2.Use the following DAX expression to create a table named 'Time'

Time = ADDCOLUMNS(GENERATESERIES(TIME(9,0,0),TIME(17,0,0),TIME(1,0,0)),"Column",HOUR([Value])*100+MINUTE([Value])*10+MINUTE([Value]))

vzhouwenmsft_7-1716361940163.png

2.Use the following DAX expression to create columns in 'Table'

Column1 = IF(ISBLANK([StartTime]),900,HOUR([StartTime]) *100 + MINUTE([StartTime])*10 + SECOND([StartTime]))
Column2 = IF(ISBLANK([EndTime]),1700,HOUR([EndTime]) *100 + MINUTE([EndTime])*10 + SECOND([EndTime]))

3.Use the following DAX expression to create a measure

Measure = 
VAR _a = SELECTEDVALUE('Time'[Column])
VAR _b = CONCATENATEX(FILTER('Table','Table'[StartTime] <= _a && 'Table'[Column2] >= _a ) ,'Table'[Activity]," "&",")
RETURN _b

4.Final output

vzhouwenmsft_8-1716362057447.png

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors