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

Finding tickets opened at certain times and weekends.

Hi!

 

I am building a report to show tickets created from 9:00 PM to 7:00am.

I would also like to show tickets submitted over the weekends from 9:00 PM Friday to 7:00AM Monday. 

 

I have a column in my dataset called Created and the format of the column goes as the following, 5/17/22 04:02 PM

 

Can someone else me develop the DAX function for these two asks?

 

Thank you!

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

You need a calendar table with hour level granularity. Yes, 24x the size of your regular calendar table...

 

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

View solution in original post

3 REPLIES 3
v-rongtiep-msft
Community Support
Community Support

Hi @Anonymous ,

Please refer to my pbix file to see if it helps you.

Create two columns.

Column =
VAR _guding =
    TIME ( 21, 00, 00 )
VAR _monguding =
    TIME ( 7, 00, 00 )
RETURN
    IF ( 'Table'[time] >= _guding || 'Table'[time] <= _monguding, 1, BLANK () )
work =
VAR _weekday =
    WEEKDAY ( 'Table'[created], 2 )
RETURN
    IF ( _weekday >= 5 && 'Table'[Column] = 1, "submit weekend", BLANK () )

vpollymsft_0-1653027572433.png

If I have misunderstood youe meaning, please provide your pbix file without privacy information and desired output.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Exactly what I needed! Thank you!

lbendlin
Super User
Super User

You need a calendar table with hour level granularity. Yes, 24x the size of your regular calendar table...

 

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

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.