March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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.
Solved! Go to Solution.
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
)
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.
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
)
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
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
167 | |
117 | |
63 | |
57 | |
50 |