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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
JayTG123
Advocate I
Advocate I

Show me everything between Saturday & Sunday dates.

Hi all,

 

I have start and end dates in my raw data. I am looking for a way in which Power Bi can show me everything that took place between weekends (a Saturday & Sunday). Is this achiveable  ? I need to get totals.

Screenshot attached is raw data with start and end dates. Everything that hasnt had a start or end date is showing in Power Bi as 01/01/9999 - these all need to be excluded. 

 

Any help is appreciated.

 

Jay.

 

Screenshot 2022-05-27 111042.jpg

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @JayTG123 ,

 

I am not sure if I understood your question correctly. If you want to calculate that the start and end dates fall within the same week and on weekends, then please try the following calculated column.

 

IsInWeekends = 
IF (
    WEEKDAY ( [actual_start_date], 1 )
        IN { 6, 7 }
            && WEEKDAY ( [actual_end_date], 1 )
                IN { 6, 7 }
                    && DATEDIFF ( [actual_start_date], [actual_end_date], DAY ) <= 1
                    && [actual_start_date] <> dt"9999-1-1",
    1
)

vkkfmsft_2-1653977713644.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-kkf-msft
Community Support
Community Support

Hi @JayTG123 ,

 

I am not sure if I understood your question correctly. If you want to calculate that the start and end dates fall within the same week and on weekends, then please try the following calculated column.

 

IsInWeekends = 
IF (
    WEEKDAY ( [actual_start_date], 1 )
        IN { 6, 7 }
            && WEEKDAY ( [actual_end_date], 1 )
                IN { 6, 7 }
                    && DATEDIFF ( [actual_start_date], [actual_end_date], DAY ) <= 1
                    && [actual_start_date] <> dt"9999-1-1",
    1
)

vkkfmsft_2-1653977713644.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you so much @v-kkf-msft !! this has worked!!!! 

 

Apologies for the late response... I have been on paternity leave. 

 

Thanks again.
Jay

Arul
Super User
Super User

@JayTG123 ,

try this in measure and let me know,

Total on Weekends = 
CALCULATE(SUM(financials[ Sales]),
OR(WEEKDAY(actual_start_date)=6,WEEKDAY(actual_start_date)=7),
OR(WEEKDAY(actual_end_date)=6,WEEKDAY(actual_end_date)=7))

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.