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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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 ACCEPTED SOLUTION
Anonymous
Not applicable

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

 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.